Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Cannot find symbol method =(

807601Jun 4 2008 — edited Jun 4 2008
Hi all, I working on my final project for my first year AP Java class and I've run into a little snag. It seems that arraylists don't want to cooperate with me.
if(ID == 0)
{
	System.out.print("\nEnter a card ID to search for: ");
	search = Keyboard.readString();	
	for(int i=0; i<array.size(); i++)
	{
	         if(search.equalsIgnoreCase(array.get(i).getID()))
		{
			System.out.println("\n" + array.get(i));
			found = true;
		}
	}
}
This is where I get the error "cannot find symbol method getID()". Some more info without posting the pages of other code: The arraylist is created in a read class which is returned to the driver and then given to a menu class which calls the search class which is partially posted above. I don't understand why I'm having this error at all. From what I understand, the get method should return the object in the given index of the arraylist. Everything in the class which has the method I'm calling (getID()) complies perfectly. At this point, I don't know what else to do. If any more of my code is necessary, let me know, I'm glad to post it. Any help or a point in the right direction is awesome. Thanks!

(The keyboard class is essentially a watered down version of the scanner class that I'm required to use.)
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 2 2008
Added on Jun 4 2008
10 comments
877 views