public class UseArgument {
public static void main(String[] args) {
System.out.print("Hi, ");
System.out.print(args[0]);
System.out.println(". How are you?");
}
}
/******************** ***************** ****************************/
* Execution: java UseArgument yourname
*
* Prints "Hi, Alan. How are you?" where "Alan" is replaced by the
* command-line argument.
*
* % java UseArgument Alan
* Hi, Alan. How are you?
*
* % java UseArgument Jose
* Hi, Jose. How are you?
*
********************* **************** ****************************/
Not Satisfied ? Just search & get the result
Related posts:
