class CommandLineExample{
public static void main(String args[]){
System.out.println("Your first argument is: "+args[0]);
System.out.println("Your Second argument is: "+args[1]);
System.out.println("Your Third argument is: "+args[2]);
}
}
output:
>java CommandLineExample 2 5 7
Your first argument is: 2
Your Second argument is: 5
Your Third argument is: 7
public static void main(String args[]){
System.out.println("Your first argument is: "+args[0]);
System.out.println("Your Second argument is: "+args[1]);
System.out.println("Your Third argument is: "+args[2]);
}
}
output:
>java CommandLineExample 2 5 7
Your first argument is: 2
Your Second argument is: 5
Your Third argument is: 7
No comments:
Post a Comment