Tuesday 4 August 2015

Java Tutorial : Command line Argument


Click here to watch in Youtube :
https://www.youtube.com/watch?v=pN8th2DKRjI&list=UUhwKlOVR041tngjerWxVccw

CommandLineArgExample.java
public class CommandLineArgExample
{
    public static void main(String[] args)
    {

        if (args != null && args.length > 0)
        {
            for (int i = 0; i < args.length; i++)
            {
                String commandLineArg = args[i];
                System.out.println("commandLineArg " + i + " : "
                        + commandLineArg);
            }
        }
        else
        {
            System.out.println("No command-line argument has been passed.");
        }

    }
}
Output
commandLineArg 0 : 100
commandLineArg 1 : 200
commandLineArg 2 : 300

Click the below Image to Enlarge
Java Tutorial : Command line Argument 
Java Tutorial : Command line Argument 
Java Tutorial : Command line Argument 
Java Tutorial : Command line Argument 
Java Tutorial : Command line Argument 
Java Tutorial : Command line Argument 
Java Tutorial : Command line Argument 
To Download CommandLineArgApp Project Click the below link
https://sites.google.com/site/javaee4321/java/CommandLineArgApp.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