Java study # 4 (conditional branching / if statement)

Conditional branching and repetition

** Control structure ** (Control flow): The order in which statements are executed

** Sequential ** ・ ** Branch ** ・ ** Repeat **

-** Sequential -Simply execute the following statement. I've been using it so far - Branch -Execute different statements depending on the conditions (example; Yes / No statement) - Repeat **-Repeat the same sentence until the condition is met. (Until you can)

** Structured Theorem **-(Combining the above three makes it possible to create even the most complex programs)

――If you make a slightly combined example sentence ...

boolean tenki = true;
if (tenki == true) {
    System.out.println("Do the laundry");
    System.out.println("Go for a walk");
} else {
    System.out.println("Watch a movie at home");
}

In this statement, if tenki (weather) is true (sunny), tenki == true processing is performed, and if false (rain), else processing is performed.

** if statement **

--If you use if, you can "branch" --Write a conditional branch in () of if. --Use "==" to check if the variable tenki is true. --Write false processing in else.

That's all for today ...

Aside from being busy, I drank too much! No progress! good night(;_;) (Tomorrow we will repeat ... planned!)

Recommended Posts

Java study # 4 (conditional branching / if statement)
[Java ~ Conditional branching / Iterative processing ~] Study memo (3)
Try using conditional branching other than if statement
[Introduction to Java] Conditional branching (if statement, if-else statement, else if statement, ternary operator, switch statement)
[Java] Conditional branching is an if statement, but there is also a conditional operator.
[Java] "Setting" using Enum rather than conditional branching by if statement -Strategy Enum
Ruby study memo (conditional branching)
java (conditional branching and repetition)
[Ruby] conditional branch if statement
Java conditional branching: How to create and study switch statements
if statement
Java, if statement / switch statement starting from beginner
Basics of java basics ② ~ if statement and switch statement ~
java conditional branch
[Java] Study notes
Java 8 study (repeatable)
Java study memorandum
Study Java Silver 1
Java for statement
[Java] Conditional branch
Java switch statement
Conditional branching of the result of SQL statement to search only one in Java
[Java] for statement, while statement
Omission of curly braces in if statement (Java silver)
Java instruction execution statement
java learning (conditional expression)
Java Silver Study Day 1
[Java] for statement / extended for statement
[Java ~ Method ~] Study memo (5)
Program using conditional branching
About Ruby if statement
Java study # 1 (typical type)
Conditional branching of numbers
10 Corresponds to if statement
[Java ~ Array ~] Study memo 4
Studying Java-Part 10-if statement
(Memo) Java for statement
My Study Note (Java)
Also complicated conditional branching
What I learned in Java (Part 4) Conditional branching and repetition
Java review ③ (control syntax [if / switch / while / for], conditional expression)
I want to simplify the conditional if-else statement in Java
Study Java # 2 (\ mark and operator)
About for statement and if statement
Study java arrays, lists, maps
[Java] Basic statement for beginners
Swift conditional branch statement summary
Java Silver Study Method Memo
[Java ~ Boolean value ~] Study memo (2)
Java if and switch statements
Let's understand the if statement!
Java programming basics practice-for statement
Java study # 7 (branch syntax type)
[Ruby] Conditional branching Conditional expression order
[Ruby] Conditional bifurcation unless statement
☾ Java / Iterative statement and iterative control statement
A little complicated conditional branching
Java study memo 2 with Progate
Java programming basics practice-switch statement
[Ruby] problem with if statement
Study Java with Progate Note 1