Hello all and thanks for the forum. I am trying to understand some basics for a class I am taking. I need to add a boolean method contains to my class called IntList which already has a bunch of other methods in it I created. All the method needs to do is return true if the parameter I am adding is already in my list and false if it isnt. I am passing in a list of integers from a file that is being scanned in to my
test driver eventually if that helps. Not looking for an answer directly just someone to help me lay out the method. My book uses a while statement but in looking online I have found bits of pieces of if/else statements that are supposed to work as well.
Keep in mind I am barely learning the basics so basic level explanations would help me a lot. I am guessing but I am comparing ints not strings so I dont think I have to use compareto? Also I after I figure out what type of statement to write I need to look at my objects and values and figure where they go in the statement.