Oracle
1Z0-803 · Question #65
Which declaration initializes a boolean variable?
The correct answer is D. boolean j = (1 < 5) ;. The primitive type boolean has only two possible values: true and false. Here j is set to (1 <5), which evaluates to true.
Working with Java Data Types
Question
Which declaration initializes a boolean variable?
Options
- Aboolean h = 1;
- Bboolean k = 0;
- Cboolean m = null;
- Dboolean j = (1 < 5) ;
How the community answered
(17 responses)- B6% (1)
- D94% (16)
Explanation
The primitive type boolean has only two possible values: true and false. Here j is set to (1 <5), which evaluates to true.
Topics
#boolean#data types#variable declaration
Community Discussion
No community discussion yet for this question.