+3 votes
in JAVA by
Write a Java program that prints all the values given at command-line.

1 Answer

0 votes
by

Program

class A{  

public static void main(String args[]){  

  

for(int i=0;i<args.length;i++)  

System.out.println(args[i]);  

  

}  

}  

compile by > javac A.java  

run by > java A sonoo jaiswal 1 3 abc  

Output

  • sonoo
  • jaiswal
  • 1
  • 3
  • abc   
...