+ 3
What are the different ways to write a main method in java....??
3 Réponses
+ 1
as mentioned in java documentation:http://docs.oracle.com/javase/specs/jls/se7/html/jls-12.html#jls-12.1.4
public static void main(String[] args) or public static void main(String args[])
public static void main(String... args).
but the positions of public and static may change by the programmer; any parameters can be also used for the main method but the main with String[] args will be executed first. a java program can even be executed without a main method in a way.
0
hmm..thnx for the answer....☺😊👍
0
type main then ctrl+space in eclipse 😃