Q. What is the output of System.out.println(2 + 3 * 4);?
Solution:
In Java, multiplication has higher precedence than addition. So, 3 * 4 = 12, then 2 + 12 = 14.
Get Question Bank
Strengthen Your Practice with our comprehensive question bank.
In Java, multiplication has higher precedence than addition. So, 3 * 4 = 12, then 2 + 12 = 14.
Strengthen Your Practice with our comprehensive question bank.