You are on page 1of 2

public class DataTypesB {

public static void main(String[] args) {


System.out.println();
}
}
public class Arithmetic {
public static void main(String[] args) {
int myNumber =
System.out.println(myNumber);
}
}
int
int
int
int

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

Ternary Conditional: a shortened version of an if/else statement that return


s a value based on the value of a Boolean expression
Switch: allows us to check equality of a variable or expression with a value
that does not need to be a Boolean
***********************************

You might also like