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
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.