Java Data type


Data Type

The data type use for describe things. Java data types are divided into two types: built-in type and extended type.


The built-in type is the basic data type provided by the Java language itself, such as integer, floating point, character, boolean, and so on. The extension type is the Java language according to the basic type of expansion of other types, Java requires all the extension types must be included inside the class definition, which is why Java is the object-oriented programming language reasons. Although different from the pure object-oriented language, such as SmallTalk, Java retains the basic data type, but this is mainly to meet the Java high-efficiency implementation requirements. JRE (Java Runtime Environment) provides a rich and useful extension type for programmers to use, and through the class inheritance mechanism can also be extended as needed.


Built-in type

Java built-in types include the following :

Type name Definition value
boolean boolean, for binary judgment true , false
byte 8-bit signed integer minimum value -128, maximum 127
short 16-bit signed integer minimum value -32768, maximum 32767
int 32-bit signed integer minimum -2147483648 (-2 31 ), max 2147483647 (2 31 -1)
long 64-bit signed integer - 2 63 ~ (2 63
float 32-bit floating point 1.4E-45 ~ 3.4028235E38
double 64-bit floating point 4.9E-324 ~ 1.7976931348623157E308
char 16-bit Unicode characters not applicable



Copyright 2014-2017 by DeveloperTut.com. All Rights Reserved.
TwitterGoogle+Facebook