Vidyalelo
Java Programming · Q63

Miscellaneous Java

Programming · Java Programming · question 63

Q63

What will be the output of the following Java snippet, if compiled and executed with command line "hello there"? 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
Answer
B.
Output would be "hello"
C.
Output would be "there"
D.
Output would be "hello there"

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board