Definitions
P = the name of the package
C = the name of the class
The example model package P;
class C {
void start(){
}
public static void main(String[] args) {
new C().start();
}
} |
|
Explanation:
1. Mention which package you are working in. |
|
3. The main method is the entry point for your application. We will not work in the main method, because that can be messy.
public static void main(String[] args) {
}
In short, to make it possible to start your program you need to give your computer these signals (main, public, static, void, String, args, [ ]).
WHY? |
|
If you combine all those lines you will see that the following skeleton arises. Btw this is the same as the one you see at the top of the page:
The example model package P;
class C {
void start(){
}
public static void main(String[] args) {
new C().start();
}
} |
|