In Java language, every application must contain a main method whose signature is one of the following method heading
public static void main(String[] args)
public static void main(String... args)
public static void main(String args[])
- public - can be accessed from anywhere
- static – can be invoked without instantiating the class
- void - the method returns nothing
- main – the name of the method
- String args[] – the method arguments
Java developer could write the modifiers public and static in either order (public static or static public), but the general convention is to use public static as shown above. Java developer can name the argument anything s/he wants, but most software developers choose "args" or "argv".
0 comments:
Post a Comment