the main method in java is the first entry point of the program and the most familiar structures in the Java language. Following are some valid main() signatures in java:
//Most common form of main method
public static void main(String args[])
{
System.out.println("Main method');
}
//the String argument can have any name
public static void main(String[] someOtherName)
{
System.out.println("Main2");
}
//this is also valid
public static void main(String... args)
{
System.out.println("Main3");
}
//acceptable signature for main() in java
public strictfp static void main(String[] args)
{
System.out.println("Main4");
}
0 Comment(s)