• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

ArrayList driving me crazy !!!!!

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok guys begginer here, I have a problem that drives me crazy

I try to create an arraylist but I keep getting identifier expected and '(' or '[' expected errors, I thought its something I do, but I copied and tried an example snippet from the net and exactly the same, I use 1.6 sdk

here's the example snippet



and the error I get is :




can anyone help it is killing me !!!

thanks

[ April 28, 2008: Message edited by: manolo zapata ]
[ April 28, 2008: Message edited by: manolo zapata ]
 
Ranch Hand
Posts: 265
Hibernate Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Manolo,
Are you sure Java 6 is the first JDK on your path?

Assuming you're on windows, open a command line, and type "PATH" and see what's there.

It looks like the version of javac being found is Java 1.4 or earlier (pre-Generics). The example code you gave runs fine on my system with Java 6.
 
manolo zapata
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had a look and it seems you are right

it goes through 1.4.2 first

I will try and fix this ,

thanks very much for the help (dont go away sorta speak, I bet I'll need more help with this )


thanks a lot man
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!