Mastering Java: The Ultimate Quiz for 'Thinking in Java'

Disable ads (and more) with a membership for a one time $2.99 payment

Mastering Java: The Ultimate Quiz for 'Thinking in Java'. Dive deep into Java with multiple-choice questions. Challenge yourself with quiz questions designed to test and improve your understanding of the 'Thinking in Java' book. Get ready for your exam!

Practice this question and more.


What is the precedence of the multiplication (*) operator relative to the addition (+) operator in Java?

  1. Lower

  2. Equal

  3. Higher

  4. None of the above

The correct answer is: Higher

In Java, the multiplication operator (*) has a higher precedence than the addition operator (+). This means that in an expression containing both operators, the multiplication will be evaluated first before the addition. Option A is incorrect because it states that the precedence of multiplication is lower, which is false. Option B is also incorrect because it suggests that both operators have equal precedence, which is not the case. Option D is also incorrect because it does not provide any information about the precedence of the two operators.