Home / Programming MCQs / JAVA MCQs / Question

M

Mr. Dubey • 51.17K Points
Coach

Q. What will be the result of compiling the following code?~~~public class Test~~~{~~~static int age;~~~public static void main (String args [])~~~{~~~age = age + 1;~~~System.out.println("The age is " + age);~~~}~~~}

(A) Compiles and runs with no output.
(B) Compiles and runs printing out The age is 1.
(C) Compiles but generates a runtime error.
(D) Compiles but generates a compile time error.

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.