How to display the number of command line arguments in Java

1 Answer

0 votes
public class MyClass {
    public static void main(String args[]) {
        System.out.println(args.length);
    }
}



/*
run:

3

*/

 



answered Apr 4, 2021 by avibootz

Related questions

1 answer 112 views
1 answer 159 views
1 answer 147 views
1 answer 164 views
1 answer 168 views
...