Professional Documents
Culture Documents
Corso Java
Corso Java
sum = 34 + 113;
difference = 91 - 205;
product = 2 * 8;
quotient = 45 / 3;
RIASSUNTO 1
Congratulations! You've learned some of the building blocks of Java programming.
What can we generalize so far?
Data Types are int, boolean, and char.
Variables are used to store values.
Whitespace helps make code easy to read for you and others.
Comments describe code and its purpose.
Arithmetic Operators include +, -, *, /, and %.
Relational Operators include <, <=, >, and >=.
Equality Operators include == and !=.
A full understanding of these concepts is key to understanding the remainder of
the Java course. Let's keep going!
***************************
The precedence of each Boolean operator is as follows:
! is evaluated first (not)
&& is evaluated second (=)
|| is evaluated third (or)
Like numerical expressions, every expression within parentheses is evaluated fir
st. Expressions are also read from left to right.
RIASSUNTO 2
Great work! Control flow allows Java programs to execute code blocks depending o
n Boolean expressions. What did we learn about control flow so far?
Boolean Operators: &&, ||, and ! are used to build Boolean expressions and h
ave a defined order of operations
Statements: if, if/else, and if/else if/else statements are used to conditio
nally execute blocks of code