|
-
March 22nd, 2010, 03:06 AM
#1
Help with using .equals in arrrayList Extreme novice
Hi there I am just trying to learn java and am really stuck on a problem, was just wondering if anyone can help me figure it out. I may not be able to explain what i am trying to do well enough for anyone to understand so don't be too hard on me 
I have 2 classes and am using an arrayList to add objects from class Track into class PlayList which contains the arrayList. I am trying to use the .equals method of the string class to find an artist by name and print out their details if their name is searched for and found. I have written the following code and get the error message ')' expected but don't understand what that means?
public void String (Track returnName)
{
if (returnName.equals(Track artist))
{
System.out.println(printDetails);
}
else
{
System.out.println("There is no artist with this name");
}
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|