Since we are going to be working with strings, the constructor would look like:

public static boolean nameCheck (String answer);

We have to use public static because we are writing a method and the type of method is boolean

*just a side note, and i'm sure another tutorial says something about this*
a function or method in java must start with public static because it is apart of the constructor, which I mentioned earlier.

We also use void because when the main method sees that sub-method, it stops then goes to where it we defined it and does what we told that sub-method to do.

Anyway, so what is this function going to do specifically? We will be checking if an entered string is the same as a constant string.

Notice that in JAVA we can't just if(name=="fred"). At least I have never seen it, so we use compareTo() which will make it into an integer and if we put it into an if statement we could have a couple of possibilities:

1! The strings will equal 0 which means that they are equal.
2! One of them is bigger than another which would mean that they are not equal to each other.

*NOTE: If you notice, we are still going to use an int to check if the comparison is true or not, we just use String because that is the type of variable we are putting into the sub-method.*

Okay, so what do we want to do after we checked if the comparison is true or not?

We want to let the user know because in the boolean it just checks if it is true or not, it doesn't display anything. So the main method would look like:

The only difference between the string boolean and the int boolean is the type of data you are putting into the boolean.

The first two booleans we did were just checking if it was true (the boolean itself and in the main we were doing stuff with the boolean value). There are a couple more things we can do with these types of functions, but in order to learn those, we had to start from the basics-thus the first two tutorials.

Thank you again for stopping by, please come back for yet another part of these interesting functions.