If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Enjoy an ad free experience by logging in. Not a member yet? Register.

Syntax Definitions

I've been doing a couple of Java tutorials that I've found online, however none of them seem to sufficiently explain some of the syntax that I am using. I don't really want to leave a hole in my knowledge, so I was wondering if someone could explain what some of these keywords (not sure of what term to use when referring to them) mean.

public: This is an access keyword used to define what type of access other objects have to your class and its methods. public will let any objects create an instance of your class and use its public methods. There is also Private that restricts access to the current class, and Protected which restricts access to classes in the same package as your class.

static: This defines class attributes/methods/variable. In simple terms, this means that there is only one main method across all of the instances of your class.

void: This is the return type for the method. Void means that the method does not return anything.

{String[] args}: This is the argument list for the main method. The main method takes a String Array(String[]) of arguments, and "args" is the variable that references that array.