Professional Documents
Culture Documents
constructs
Recognize assignment compatibility and required casts in fundamental
types
Use if, switch, for, while, and do constructions and the labeled forms of
O2
Static O5
variable
O3 O stands for O6
Object
OOP using Java Prepared by Mulugeta M. 7
Instance vs. Static variables
O1 Instance O4
Instance variable
variable
Each object
has its own
data for the
instance
variable Instance
variable
O2 Instance
variable O5
Instance
Instance variable
variable
O3 O stands for O6
Object
OOP using Java Prepared by Mulugeta M. 8
Java Operators
Refer to
E.g.
int x=34;
Logical operators
Relational operators
== (equal),
that can work directly with the bits that make up the integers.
The bitwise operators are
& (“and”)
| (“or”)
^ (“xor”)
conversions
that may lose
precision
nx is now 10
nx is now 9
if Conditions
if condition
If…else condition
statement2 {
for loop
while loop
do…while loop
Example
initialization;
while ( loopContinuationCondition )
{
statement
int x=0;
while(x<4)
increment; {
} System.out.println(“x=“+x);
x++;
}
break in
switch statements
repetition statements.
continue Statement
The continue statement, when executed in
constructs
Recognize assignment compatibility and required casts in fundamental
types
Use if, switch, for, while, and do constructions and the labeled forms of
Operators
Casts
Conditions
Loops