Page 1 of 1

What will be the output of the following Java code snippet?

Posted: Wed Jul 13, 2022 7:45 pm
by answerhappygod
class abc{ public static void main(String args[]) { if(args.length>0) System.out.println(args.length); }}
a) The snippet compiles and runs but does not print anything
b) The snippet compiles, runs and prints 0
c) The snippet compiles, runs and prints 1
d) The snippet does not compile