ahh i see what im doing wrong. I need a boolean, but how do i substitute?

It's no different than say if you were writing a program to check a person's age. Say you had method that returned an int - like indexOf() - and you wanted to see if they were 18. You would write something like this:

Java Code:

if(person.getAge() < 18)
{
System.out.println("No Entry!");
}

Ie you construct a boolean expression like "person.getAge() < 18" that will be good for the if statement. To see what boolean expression you should use read the indexOf() API docs to see what int value it returns under various conditions including when the target is not in the string.

Don't worry about this: although you are calling it character it is declared to be a String. Presumably it is a one letter String that the user enters. indexOf() will find it (or not) quite happily.

-----------------

(This assumes that you keep using the form of indexOf() that takes a String argument. If you like you could get the first char of the String character and use the other form of indexOf(). In that case you are right: you can use a char where the method wants an int)

im trying my best to understand :( so can i test if a string has the "character" in the string entered by user? if not, what should i use? :confused:
im sorry, i know im a pain in the butt but im trying my best

Still a newbee.. on chapter 7 of 15 in the book "Starting out with Java", by Tony Gaddis. :) (GUIs!!!! :D)

Take your time reading those API docs. The style is dense and favours logical precision and completeness over friendliness, but they are well worth the effort. I mention this because indexOf() comes in yet another flavour that will prove most helpful in counting occurances.