public static void main(), by declare main as static, it gives you one and only one starting point of the program.
Also static defines Class variable and method. You can access them via the class name.
For example:
Class A {
public static aClassMethod(){
}
}
You don't need to instantiate an object instance of class A to access aClassMethod.
A.aClassMethod();
will do the job for you Instead of
new A().aClassMethod();
In RMI, the value of static variable will not be passed to the caller, just be careful about it.
Also static defines Class variable and method. You can access them via the class name.
For example:
Class A {
public static aClassMethod(){
}
}
You don't need to instantiate an object instance of class A to access aClassMethod.
A.aClassMethod();
will do the job for you Instead of
new A().aClassMethod();
In RMI, the value of static variable will not be passed to the caller, just be careful about it.