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 137 views
1 answer 173 views
1 answer 163 views
1 answer 177 views
1 answer 181 views
...