How to display the command line arguments in Java

1 Answer

0 votes
public class MyClass {
    public static void main(String args[]) {
        for (int i = 0;i < args.length; i++) {
            System.out.println(args[i]);  
        }
    }
}
 
 
 
 
/*
run:
 
java
c
c++
 
*/

 



answered Apr 4, 2021 by avibootz

Related questions

1 answer 112 views
1 answer 158 views
1 answer 168 views
1 answer 164 views
1 answer 168 views
...