Code:public class xxxXXX
{
public static void main()
{
}
}
- "static" what means ?
- the class xxxXXX how is executed in this java program(file) , I mean the whole java program contained ? A class that has method "main" differs from a normal class ?
Printable View
Code:public class xxxXXX
{
public static void main()
{
}
}
- "static" what means ?
- the class xxxXXX how is executed in this java program(file) , I mean the whole java program contained ? A class that has method "main" differs from a normal class ?
'static' means that the method belongs to the class itself, not to the instances of the class (i.e. you doxxxXXX.main(foo)rather than(new xxxXXX()).main(foo)).
You run the application like you would any other:java <classname>. A class with apublic static void main(String[])differs from other classes only in that it can be used as an entry-point into your application.
It's conventional to begin class names with a capital letter.