Professional Documents
Culture Documents
Computer Programming II - Lecture 3
Computer Programming II - Lecture 3
Lecture 3
Object-Oriented Programming in Java
You learned:
You’ll learn:
● Control Statements
○ Expressions
○ Statements
○ Selection
○ Repetition
○ For Loops in Java
○ While Loops in Java
○ Continuous Loops and the Break Statement
Expressions
An expression in the context of computer programming languages is a formula. As such, expressions are
composed of one or more operands whose values are combined by operators.
operand1 < 50
operand2 == 0
operand1 & operand2 ; will return false if operand1 is false regardless of the value of operand2
operand1 | operand2 ; will return true if operand1 is true regardless of the value of operand2
operand1 || operand2
Statements
Statements are the commands in a language that perform actions and change the state of an object.
Choice points into flow of control path so that we can have several paths going through
a program
1. If-else statements
2. Switch statements
If-else Statements