Java Reference
In-Depth Information
Chapter 1:
Data Types
Java provides a rich set of data types. Every variable declared or defined has a particular
data type. The assigned data type specifies the size and the type of values that a variable can
store. Java provides a number of data types which have their particular significant in decid-
ing the appropriate type by the programmer while programming.
There are mainly two basic types of data types:
 Primitive
 Non- primitive
Primitive data types
Primitive data types are also known as built-In data types. These data types are predefined
by the language. Java provides the following primitive data types in Java :
Byte
8 bit signed in-
teger
Rang e is -128 to
127
Used
in
arrays
where memory significantly matters.
Int
Integer Data type are 32 bit signed integer
Minimum
value
is
-
2,147,483,648.(-2^31)
and
Maximum
value
is
2,147,483,647
Default value is zero.
Short
16 bit signed integer
Search WWH ::




Custom Search