- 4
Please explain true or false code
4 ответов
+ 10
True = True
False = False
Code = Code
+ 5
something is true if it is not false.
something is false if it is not true.
😛
A boolean can be only true or false.
True means correct.
Am I correct to say 2 equals 2?
Yes, ok so 2 == 2 is true.
boolean a = (2 == 2);
// a is true
+ 1
Some thing is true when it is.
Some other thing is false when it is not.
0
it also relate with conditional statement
eg....
if (password1.equals (password2)){
JOptionPane.showMessageDialog(rootPane"welcome ")
}
else{
JOptionPane.showMessageDialog(rootPane"check password and try again")
}
this shows if the data you input in password field 1 is true to that of passwords Field 2
I.e
password1= Victor
password 2 = Victor
display the true message (welcome)
otherwise,
password 1 = Victor
password 2 = victorh
display the true message (check password and try again)
@
my understanding