In this section we will discuss Java 7 Data Types.
Data Types :
Data types are the keywords stored in the reserved memory which we use
to define type of variables.
There are two types of data types defined in java 7 -
Primitive Data Types:
Primitive data types is already defined and represented by the reserved keyword. Value of primitive type don't share state with another primitive values. Java 7 supports eight primitive data types -
Reference data types :
Non-primitive data types are also called reference data types. It is handled by reference. These refer to objects and arrays. it is created by defining constructor of a classes. You can use it to access the objects.
When you initialize variable of primitive type, do not use new keyword. we built into the language. Literal is source code representation of a fixed value. It represents directly to your code without requiring computation. literals are used to assign to any primitive type variable.
short value = 40;
boolean test = true;
Posted on: December 18, 2012 If you enjoyed this post then why not add us on Google+? Add us to your Circles