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 133 views
1 answer 172 views
1 answer 161 views
1 answer 176 views
1 answer 178 views
...