Java View all facts Glossary Help |
member > class member > class method > main method |
main method | ||||
subject | fact |
main method | calls other methods to run an application | |
has definition A method that is initially executed in an application | ||
has main method signature | ||
has method signature public static void main(String[] args) | ||
is the first method called when the Java interpreter executes an application | ||
is the starting point for an application | ||
is part of a class | ||
is similar to a main function in C | ||
is a subtopic of Methods | ||
is a kind of class method | ||
must be | ||
must have one argument of type String[] | ||
class method |
| |
affects the class as a whole, not a particular instance of the class | ||
can be accessed from | ||
cannot access directly any instance variable | ||
cannot be overridden | ||
has purpose implementing functions such as initializing a class, or operating on the complete set of instances of a class | ||
is called by using the name of the class, followed by a dot, followed by the name of the method (the name of the class can be omitted when calling a class method in the current class) | ||
is marked as static | ||
operates on 0 or more class variables of its class | ||
specifies the behaviour of the class | ||
class member | can be used by every method of the class | |
method | belongs to a class | |
can access all instance variables of all objects of its class | ||
can be accessed by other methods and variables in any class in the same package by default | ||
can use the super method to invoke a method declared in the superclass | ||
cannot be passed as an argument to a method or constructor | ||
creates an object by instantiating a class | ||
does not return a value if it has a void return type | ||
has part method definition | ||
has part method signature | ||
has part a block of implementation code | ||
implements | ||
may contain empty return statement if it has a void return type | ||
may have access modifier | ||
must contain return statement unless it has a void return type | ||
must define its parameter list | ||
must define its return type | ||
returns a value that is of the return type of the method or a subtype of that type | ||
should return to its caller from only one place which should be the last statement | ||
usually hides instance variables, class variables from other objects | ||
access unit | has access mode | |
syntactic unit | has syntax rule bold = mandatory |
Next class method: parseInt Up: class method Previous class method: isDigit