1z0-811 Exam QuestionsBrowse all questions from this exam

1z0-811 Exam - Question 1


Which statement is true about primitive variables?

Show Answer
Correct Answer: A,B

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

8 comments
Sign in to comment
vin_son01Option: A
Mar 18, 2023

Option A is correct

falchettoOption: A
May 9, 2023

A is the correct answer

supercoderOption: A
Nov 1, 2023

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

tabrezshaikh13Option: A
Jul 12, 2023

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

tabrezshaikh13Option: A
Jul 19, 2023

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

supercoderOption: A
Nov 1, 2023

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

krysitian
Mar 18, 2024

First Question an such a mess...

ketty04Option: A
Jul 18, 2024

Option A is correct