Mastering Java: The Ultimate 2026 All-In-One Quiz to Excel in 'Thinking in Java

1 / 510

What type of variables does the assignment with primitives in Java affect?

Object references

Primitive values directly

When assigning a primitive value in Java, the assignment affects the primitive value directly. This means that any changes made to the assigned variable will directly affect the assigned value and not any other references or class variables. This is different from assigning object references, which affect the reference to an object rather than the actual object itself. Java does allow assignment with primitives, contrary to option D, which is why option B is the correct answer.

Get further explanation with Examzify DeepDiveBeta

The class variables

Java does not allow assignment with primitives

Next Question
Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy