3.1 Datatypes
3.1 Datatypes
in Java
By Upekha Vandebona
Java Is a Strongly Typed
Language.
Loosely typed languages: PHP,
JavaScript.
Every variable has a type, every
expression has a type, and every
type is strictly defined.
The Java compiler checks all
expressions and parameters to
ensure that the types are compatible.
Declaring a Variable
Java cares about type.
Primitive
Variable
Object
Reference
8 Primitive Types are
Integers, whole-valued
byte, short, int, long, signed numbers.
ch1 = 'X';
System.out.println("ch1 contains " + ch1);