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
No comments:
Post a Comment