java learning (conditional expression)

Relational operators (comparison of strings)

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.

Logical operator

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

Negation operator

if(!(age >= 18)) {

If you are over 18 and not

Recommended Posts

java learning (conditional expression)
Java learning (0)
Java basic learning content 9 (lambda expression)
For JAVA learning (2018-03-16-01)
Java conditional branch
Java learning day 5
java conditional branch
[Java] Lambda expression
[Java] Conditional branch
Java lambda expression
java learning day 2
java learning day 1
Java learning 2 (learning calculation method)
java neutral lambda expression 1
Java learning memo (method)
Java Learning (1)-Hello World
Java lambda expression variations
JAVA learning history interface
Java learning memo (basic)
Java 8 lambda expression Feature
java lambda expression memo
Java lambda expression [memo]
Studying Java 8 (lambda expression)
Java learning memo (interface)
Review java8 ~ Lambda expression ~
Java lambda expression again
Java table expression injection
Java learning memo (inheritance)
java regular expression summary
Learning Java framework # 1 (Mac version)
Java basic learning content 7 (exception)
JAVA learning history interface inheritance
Java learning memo (data type)
[Java] Functional interface / lambda expression
Java basic learning content 5 (modifier)
Books used for learning Java
4th day of java learning
Java8 stream, lambda expression summary
Java learning memo (logical operator)
[Ruby] Conditional branching Conditional expression order
Java learning memo (abstract class)
java (conditional branching and repetition)
Java Basic Learning Content 8 (Java API)
Java Learning 1 (learning various data types)
Java basic learning content 4 (repetition)
Java review ③ (control syntax [if / switch / while / for], conditional expression)
Java learning memo (creating an array)
Deep Learning Java from scratch 6.4 Regularization
Java basic learning content 3 (operator / ternary operator)
Java learning memo (while statement, do-while statement)
Java basic learning content 2 (array / ArrayList)
Try an If expression in Java
[Android Studio] [Java] Learning memos & links
Java
Java study # 4 (conditional branching / if statement)
I tried to summarize Java learning (1)
What is a lambda expression (Java)
Java
What I researched about Java learning
Study Deep Learning from scratch in Java.
(Learning memo) Java Level 2 measures: Question range