arraylist query
From: JoshB (metrix007_at_yahoo.com)
Date: 03/30/04
- Next message: Alex: "Re: Intro articles on JavaSpaces?"
- Previous message: RC: "How to do "Please wait .....""
- Next in thread: Peter: "Re: arraylist query"
- Reply: Peter: "Re: arraylist query"
- Reply: Bryce (Work): "Re: arraylist query"
- Reply: Markos Charatzas: "Re: arraylist query"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 30 Mar 2004 10:51:51 -0800
Hi folks,
Just learning arraylists at the moment, and ran into a problem with
the trying to return the result of the contains method.
I have an arraylist called the set, and the following code:
public boolean hasElement(int element) {
// ***** SD2 Gap Assignment 2 Question 3 *****
if ((element < smallest) || (element > largest)) {
return false;
} // if.
return theSet.contains(element);
}
however it gives the error "cannot resolve symbol"
symbol : method contains (int)
location: interface java.util.List
theSet.contains(element);
any suggestions as to why this is happening?
Many thanks.
- Next message: Alex: "Re: Intro articles on JavaSpaces?"
- Previous message: RC: "How to do "Please wait .....""
- Next in thread: Peter: "Re: arraylist query"
- Reply: Peter: "Re: arraylist query"
- Reply: Bryce (Work): "Re: arraylist query"
- Reply: Markos Charatzas: "Re: arraylist query"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]