Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Valid main methods in java

    • 0
    • 1
    • 1
    • 2
    • 0
    • 0
    • 0
    • 0
    • 228
    Comment on it

    main() method in Java

    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)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: