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   

Related questions

+2 votes
asked May 13, 2021 in JAVA by rajeshsharma
0 votes
asked Oct 1, 2021 in Data Science by Robin
0 votes
asked May 4, 2021 in JAVA by SakshiSharma
...