Home / Programming MCQs / JAVA MCQs / Question

S

Shivam • 8.86K Points
Tutor III

Q. What will be the output of following java code?

Code:
public class Test{
      static int i = 5;
      public static void main(String... args){
            System.out.println(i++);
            System.out.println(i);
            System.out.println(++i);
            System.out.println(++i+i++);
      }
}
(A) 6 6 6 16
(B) 6 7 6 16
(C) 5 6 7 16
(D) 5 6 6 16

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.