Eclipse設置項目jdk的問題
因為要修改一個以前的老項目,老項目用的jdk是1.4版本,遂在項目右鍵Properties-Java Compiler中將Compiler compliance level 設成了1.4
以為萬事大吉了呢,昨晚上因為Integer的一個方法發(fā)現了問題
Integer中有個方法valueOf
static Integer |
valueOf(int i)
返回一個表示指定的 int 值的 Integer 實例。 |
static Integer |
valueOf(String s)
返回保持指定的 String 的值的 Integer 對象。 |
static Integer |
valueOf(String s, int radix)
返回一個 Integer 對象,該對象中保持了用第二個參數提供的基數進行分析時從指定的 String 中提取的值。 |
其中valueOf(int i)
- 從以下版本開始:
- 1.5
也就是在1.5之前沒有這個方法,但是在eclipse中卻有這個方法的提示
找了半天,原來問題出在這,在Java Build Path 中Libraries 中jdk是1.5的,把它remove掉,添加一個1.4的就OK了
還是功力不夠啊 充電 充電ing
posted on 2008-12-04 15:02 豬 閱讀(4429) 評論(1) 編輯 收藏 所屬分類: 學習java