adplus-dvertising
frame-decoration

Question

What would be the output of the following snippet, if attempted to compile and run this code with command line argument “java abc Rakesh Sharma”?
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

b.

Compilation but runtime error

c.

Compilation and output Rakesh :-Please pay Rs.2000

d.

Compilation and output Sharma :-Please pay Rs.2000

Answer: (a).Compile time error

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What would be the output of the following snippet, if attempted to compile and run this code with command line argument “java abc Rakesh Sharma”?