Java | Operators | Question 4

class Test {
    public static void main(String args[])  {
       System.out.println(10*20 + "GeeksQuiz");
       System.out.println("GeeksQuiz" + 10*20);
   } 
}

(A)

10*20GeeksQuiz
GeeksQuiz10*20

(B)

200GeeksQuiz
GeeksQuiz200

(C)

200GeeksQuiz
GeeksQuiz10*20

(D)

1020GeeksQuiz
GeeksQuiz220


Answer: (B)

Explanation: Precedence of * is more than +.

Quiz of this Question

GATE CS Corner    Company Wise Coding Practice

Recommended Posts:



0 Average Difficulty : 0/5.0
No votes yet.