0
What are the methods of boolean?, I cant find them.
5 Réponses
+ 2
Can you give an example?
The question is difficult to understand.
+ 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.
0
What this thing ':' means?
0
Thank you very Mach