Introducing Java Object Creation and Data Types

Object Creation

In Java, an object is created from a class.Only a Class can be converted into an Object.


Oracle Corporation
Company Oracle = new Oracle();
Class Name - Company
Variable Name - oracle

Assignment              - =
Object Generate Keyword - new
Parameter List variable - ()
Line End                - ;

Data Types
Primitive Data Types

byte - integer
char - integer
short - integer
int - integer
long - integer
float - floating point
double - floating point


Integer
Float
Binary 1/0 True/False

Integer Hierarchy
1.Long
2.int
3.short
4.char
5.byte

Floating Hierarchy
1.double
2.float

int  a = 5;              integer
long b = 7;
a+b;
(Any Arithmatic Expression)

foat   c = 7.8;         float 
double d = 9;
d-c;

long  e = 123456;      various
float f = 789.76;      types
e+f;

Access is possible if the related
Primitive Types are of the same
type. If the types are different,
it cannot be accessed directly.

Comments