0

What are the methods of boolean?, I cant find them.

27th Sep 2017, 3:34 PM
MnM
MnM - avatar
5 Réponses
+ 2
Can you give an example? The question is difficult to understand.
27th Sep 2017, 5:35 PM
Rrestoring faith
Rrestoring faith - avatar
+ 2
I assume you are talking about the ternary operator? boolean a = 4 == 4 ? true : false; If 4 == 4 is true, the boolean will be given the value 'true'. Otherwise ':', if 4 does not equal 4, it will be given the value false. It's basically just an of statement: boolean a; if (4 == 4) a = true; else a = false; (Keep in mind this was just an example, normally you would just write: boolean a = 4 == 4;) You can find all operators here: https://www.tutorialspoint.com/java/java_basic_operators.htm The Relational operators will give a boolean.
28th Sep 2017, 1:50 AM
Rrestoring faith
Rrestoring faith - avatar
0
What this thing ':' means?
27th Sep 2017, 9:31 PM
MnM
MnM - avatar
0
Thank you very Mach
28th Sep 2017, 3:58 AM
MnM
MnM - avatar