File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "adding elements into a List" Watch "adding elements into a List" New topic

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: 166
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?

Dirk Schreckmann

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]
I agree. Here's the link:
subject: adding elements into a List
It's not a secret anymore!