JavaFundamentals7_L1.pdf
(
554 KB
)
Pobierz
Java Fundamentals for Android Development
Lesson 1
Java Overview
Control Flow
Control Flow
Decision-making statements
•
if-then
•
if-then-else
•
Switch
Looping statements
•
for
•
While
•
do-while
Branching statements
•
break
•
continue
•
return
Control Flow
The If-then Statement
It tells your program to execute a certain section of code
only if a particular test evaluates to true.
void stopCar() {
// the "if" clause: car must be stopped
if (isMoving) {
// the "then" clause must stop car
isMoving = false;
}
}
Control Flow
The If-then Statement
The opening and closing braces are optional, provided
that the "then" clause contains only one statement:
void stopCar() {
// same as above, but without braces
if (isMoving)
isMoving = false;
}
Plik z chomika:
xyzgeo
Inne pliki z tego folderu:
JavaFundamentals4_L1.pdf
(2409 KB)
JavaFundamentals7_L1.pdf
(554 KB)
JavaFundamentals5_L1.pdf
(561 KB)
JavaFundamentals2_L1.pdf
(568 KB)
JavaFundamentals6_L1.pdf
(495 KB)
Inne foldery tego chomika:
Zgłoś jeśli
naruszono regulamin