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
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”
a) Compile time error
b) Output would be “hello”
c) Output would be “there”
d) Output would be “hello there”