Page 1 of 1

What will be the output of the following Java snippet, if compiled and executed with command line “hello there”?

Posted: Wed Jul 13, 2022 7:46 pm
by answerhappygod
public class abc{ String[] xyz;  public static void main(String argv[]) { xyz=argv; }  public void runMethod() { System.out.println(argv[1]); }}
a) Compile time error
b) Output would be “hello”
c) Output would be “there”
d) Output would be “hello there”