Vidyalelo
Java Programming · Q115

Miscellaneous Java

Programming · Java Programming · question 115

Q115

What will be the output of the following Java snippet, if attempted to compile and run this code with command line argument "java abc Ram Shyam"? public class abc int a=2000; public static void main(String argv[]) System.out.println(argv[1]+" :-Please pay Rs."+a);

A.
Compile time error
Answer
B.
Compilation but runtime error
C.
Compilation and output Ram:-Please pay Rs.2000
D.
Compilation and output Shyam:-Please pay Rs.2000

Answer: Option A

Solution

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