Wednesday, 29 July 2015

Java Tutorial : The Main method

/**
 * This program prints arguments passed in the output screen.
 */
public class MyApp
{

    public static void main(String[] args)
    {

        System.out.println("Argument Length : "+args.length);
        
        if (args.length == 0)
        {
            System.out.println("No arguments passed");  
        }
        else
        {
            for (String arg : args)
            {
                System.out.println(arg);
            }
        }

    }
}

Output
Argument Length : 3
peter
john
juli

Click the below Image to Enlarge
Java Tutorial : The Main method

Java Tutorial : The Main method

Java Tutorial : The Main method

Java Tutorial : The Main method

Java Tutorial : The Main method

Java Tutorial : The Main method

Java Tutorial : The Main method

Java Tutorial : The Main method
To Download DisplayAllHeadersApp Project Click the below link
https://sites.google.com/site/javaee4321/java/JavaArgsDemoApp.zip?attredirects=0&d=1

See also:
  • All JavaEE Viedos Playlist
  • All JavaEE Viedos
  • All JAVA EE Links
  • Servlets Tutorial
  • All Design Patterns Links
  • JDBC Tutorial
  • Java Collection Framework Tutorial
  • JAVA Tutorial
  • No comments:

    Post a Comment

    Google+ Followers

    Google+ Badge