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

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

Question: 1 / 50

What does the assignment operator do in Java?

Copies the value of the right-hand side to the left-hand side

The assignment operator (=) in Java is used to store or assign a value on the right-hand side to the variable on the left-hand side. This means that option A is the correct answer, as it describes what the assignment operator does. Option B is incorrect because the subtraction operator (-) is used for subtraction, not the assignment operator. Option C is incorrect because the equality operator (==) is used for comparing two values for equality, not the assignment operator. Option D is incorrect because the dot operator (.) is used for executing a method on an object, not the assignment operator.

Subtracts values

Compares two values for equality

Executes a method on an object

Next

Report this question