If the method is returning something, then the return type needs to be specified. Otherwise, "void" needs to be specified to indicate that nothing is returned.
If the method should be associated with the class (instead of a particular instance of the class), then the keyword "static" is used. Without "static," the method is an "instance" method. See Java Tutorial.
public static void = a static method which allows public access and returns nothing. This means it is available for anyone to see/use because it is public, it is associated with the class not an instance because it is static, and void always simply means there is no return value for the method.
public void = a non-static method which allows public access and again returns nothing. This means it is available to anyone just as above, but this time because it is not static it is associated with an instance not the class itself. Again because of the void there is no return type.
public 'returnType' = a public method which is showing you that where "returnType" is you may place whatever it is your would like your method to return. If you want it to return a string a method would look like
or if you wanted to return an Integer
Generally it is a good practice to search for the information on your own first prior to posting as each of these come up with tons of information if Googled. Also check out the link in marc's post. Welcome to the Ranch!
Post by:autobot
Do not set lab on fire. Or this tiny ad:
a bit of art, as a gift, that will fit in a stocking