• Post Reply Bookmark Topic Watch Topic
  • New Topic

generics  RSS feed

 
Kevin Tysen
Ranch Hand
Posts: 255
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My program has this line:


It compiles okay in Java 6 on another computer, but on this computer (Mac OS 10.3, which version of java, I don't know) I get this:

<identifier> expected

Is there something wrong with the syntax?
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kevin Tysen wrote:which version of java, I don't know


You need to know the version. Do....

java -version


Henry
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I thought 10.3 shipped with Java 1.4, but I could be wrong. You'd need to upgrade your Java if that's the case.
 
Kevin Tysen
Ranch Hand
Posts: 255
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I did java -version. The version is java 1.4.2_12. Is the generics code different in 1.4 than in java 6?
 
Campbell Ritchie
Marshal
Posts: 56553
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There was no generic code in Java1.4.2 at all.
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:There was no generic code in Java1.4.2 at all.


Generics was added in Java 5. You will need to upgrade... or remove generics from your application.

Henry
 
Rob Spoor
Sheriff
Posts: 21135
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That wasn't added until Java 5.0.
 
Campbell Ritchie
Marshal
Posts: 56553
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oooh. That's unusual. Henry and I got there before Rob.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!