This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes adding elements into a List Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "adding elements into a List" Watch "adding elements into a List" New topic
Author

adding elements into a List

Peng Fan
Ranch Hand

Joined: May 04, 2004
Posts: 35
why jvm complains about the following code? how to bypass such case?
Yosi Hendarsjah
Ranch Hand

Joined: Oct 02, 2003
Posts: 164
What's the message?
Blake Minghelli
Ranch Hand

Joined: Sep 13, 2002
Posts: 331
That code compiles fine. Can you post the error message you are getting?


Blake Minghelli<br />SCWCD<br /> <br />"I'd put a quote here but I'm a non-conformist"
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
missing or incorrect import?
Did you perhaps import java.awt.List instead of java.util.List?


42
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
To be clear, the JVM and the compiler are two different beasts.

Neither my compiler nor my JVM have any complaints about the posted code.


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
 
Consider Paul's rocket mass heater.
 
subject: adding elements into a List