2016-11-11 52 views
0

我想在jdeveloper 10g中使用ArrayList<Intger>做一個簡單的程序,但它給出瞭解析錯誤。我也嘗試了在線編輯器中的相同代碼,它工作得很好。解析ArrayList中的錯誤<Integer> jdeveloper 10g

這裏是我的代碼

import java.util.*; 

class TestCollection1 
{ 
     public static void main(String args[]) 
     { 
      ArrayList<Integer> a = new ArrayList<Integer>(); 
      a.add(1); 
      a.add(2); 
      a.add(3); 
      Iterator i = a.iterator(); 
      while(i.hasNext()) 
      { 
       System.out.println(i.next()); 
      } 
     } 
} 

此圖像顯示了編譯器錯誤:

compiler error in jdeveloper 10g

回答

0

升級到較新的IDE,JDeveloper 10g(從發行說明)的Oracle JDeveloper 10g中(10.1 .2.3,Build 1936) - 適用於Windows NT/2000/XP,Linux,Solaris,HP-UX和Macintosh。andComplete Install includes Windows JDK 1.4.2;在版本1.5(2004年發佈)中添加了generics。您的版本早於該版本,並且是end of life