Session02-Learning The Java Language
Session02-Learning The Java Language
(http://docs.oracle.com/javase/tutorial/java/index.html)
Reference DataType
Primary DataType
Session 02 - Learning the Java
Language
Primitive Data Types
• A primitive is a simple non-object data type that
represents a single value. Java’s primitive data types
are:
– boolean
– char
– byte
– short
– int
– long
– float
– double
Assignment Operator
assigns the expression value on its right to the variable on its left.
Variable = Expression;
Ex : x = 10;
x = y = z = 0;
• Condition of an if statement
must be a Boolean expression
• Evaluates to true or
false
• Output:
**********
**********
**********
**********
**********
• Output:
*
**
***
****
*****
• Output:
1
22
333
4444
55555