if (str == "Book") {
if (str equals ("Book")) {
** The top is wrong. The bottom is correct. ** **
Even above (==), the compilation error does not occur, and there is a problem that it can be executed but sometimes it behaves strangely
.
if (age >= 18 && month == 5) {
Age 18 and over, and
born in May
if (name.equals("Saito") || name.equals("Saito")) {
The name is Saito, or
Saito
if(!(age >= 18)) {
If you are over 18 and not
Recommended Posts