Exam 1z0-811 All QuestionsBrowse all questions from this exam
Question 1

Which statement is true about primitive variables?

    Correct Answer: A

    Primitive variables can be compared using the == operator. This is because the == operator checks for value equality, which is applicable to primitive data types. The equals method and compareTo method are used for objects, not primitives, which makes them unsuitable for primitive comparison.

Discussion
vin_son01Option: A

Option A is correct

supercoderOption: A

Dear Admin, please fix the correct answer for this question. Equals method can never be used for primitives , only for wrappers.

falchettoOption: A

A is the correct answer

ketty04Option: A

Option A is correct

krysitian

First Question an such a mess...

supercoderOption: A

== used to compare primitive variables example int someinteger = 54; return someinteger == 54;

tabrezshaikh13Option: A

A is the correct answer. We cannot compare primitive variables with .equals() method but only == operator

tabrezshaikh13Option: A

A is the correct answer. Primitive variables DO NOT have methods declared on them so we cannot compare them with .equals() method.