Program 2 : Getting Values from user on Command line Window.
Program :
Create a Java Program that Get Values from user on Command line Window.
Solution :
class SabTech
Create a Java Program that Get Values from user on Command line Window.
Solution :
- Here First we are displaying all the values which are entered by the user on command line window.
{
public static void main(String args[])
{
int i;
for(i=0;i<args.length;i++)
{
System.out.println("Argument " + i + " is ==> " + args[i]);
}
}
for(i=0;i<args.length;i++)
{
System.out.println("Argument " + i + " is ==> " + args[i]);
}
}
}
O/P:
>javac SabTech.java
>java SabTech Sabarmati Technology 123
Argument 0 is ==> Sabarmati
Argument 1 is ==> Technology
Argument 2 is ==> 123
Comments
Post a Comment