This week's book giveaway is in the iOS forum.
We're giving away four copies of Classic Computer Science Problems in Swift and have David Kopec on-line!
See this thread for details.
Win a copy of Classic Computer Science Problems in Swift this week in the iOS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Error: Generics are not supported in -source 1.4  RSS feed

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i was trying this code

Bill Jones wrote:
main:
ArrayList<Integer> note = new ArrayList<Integer>();
int[] myArray = new int[]{ 58,63,67,72,70,63,62,63 };
note = initArrayList(myArray);

method:
public ArrayList<Integer> initArrayList(int[] a) {
ArrayList<Integer> list = new ArrayList<Integer>();
for (int i : a) {
list.add(i);
} //close for loop
return list;
} //close initArrayList method



and i got this message from the debugger:

generics are not supported in -source 1.4
(use -source 5 or higher to enable generics)
public ArrayList<Integer> initArrayList(int[] a) {



what does it mean?
 
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This reply was originally posted by Rob Prime. Sorry for the mess...

Rob Prime wrote:That you need to change your project settings. It's now set to compile for Java 1.4.

 
Marshal
Posts: 58828
179
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And welcome to the Ranch
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!