+ 3

What are the different ways to write a main method in java....??

16th Oct 2016, 7:09 PM
Ganesh Thorat
Ganesh Thorat - avatar
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.
16th Oct 2016, 7:18 PM
mk_717
0
hmm..thnx for the answer....☺😊👍
16th Oct 2016, 7:23 PM
Ganesh Thorat
Ganesh Thorat - avatar
0
type main then ctrl+space in eclipse 😃
23rd Nov 2016, 1:26 AM
Mohammed Fakham
Mohammed Fakham - avatar