March 15th, 2001, 06:50 AM
"Ambiguous class: java.awt.List and java.util.List
private List ll;
The above error appear when i compile the java applet. I am not certain for the error and would like to know what the error is and how to correct this. Thanks!!
Comments on this post
March 15th, 2001, 08:17 AM
This just means that you have inported both java.awt.List and java.util.List and the compiler does not know which one you are trying to use when you specify "private List ..."
You are probably importing java.awt.* and java.util.* so you are getting both List classes from the two different packages. There are two ways of fixing this:
One, import only the classes you need instead of the whole package. EG - import java.util.List; instead of import java.util.*;
Two, specify the entire package name when you declare your List object. If you are really trying to use java.util.List and NOT java.awt.List try: "private java.util.List ..." instead of "private List ..."
Hope that helps.