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 CorporationCompany Oracle = new Oracle();Class Name - CompanyVariable Name - oracleAssignment - =Object Generate Keyword - newParameter List variable - ()Line End - ;Data TypesPrimitive Data Types
byte - integerchar - integershort - integerint - integerlong - integerfloat - floating pointdouble - floating pointIntegerFloatBinary 1/0 True/False
Integer Hierarchy1.Long2.int3.short4.char5.byte
Floating Hierarchy1.double2.float
int a = 5; integerlong b = 7;a+b;(Any Arithmatic Expression)foat c = 7.8; floatdouble d = 9;d-c;long e = 123456; variousfloat f = 789.76; typese+f;Access is possible if the relatedPrimitive Types are of the sametype. If the types are different,it cannot be accessed directly.



Comments
Post a Comment