HTML 5 Site
There are so called EIGHT "primitive" data types in Java. They themselves could be separated into four separate categories as the following:
Boolean and character data types have only one data type each, and there are 4 types of integer data types, and 2 types of floating point.
A boolean data type is expressed as boolean, and it can be either true or false. One would think the object of this type would only take a bit of the memory, but it actually takes up around 4 bytes or so for each object of this data type.
A character type is expressed as char, and it is 16-bit wide, allowing representations of 65536 characters.
An integer type can be expressed as the following:
There are two data types for representing a real value, float and double. According to Sun (now Oracle), it is not recommended to use float or double for precise values. A "wrapper" class such as BigDecimal is recommended for precise values such as currency. A real value can be expressed as the following:
1 year ago by Michael Han
1 year ago by Michael Han
1 year ago by Socrates
1 year ago by Michael Han
1 year ago by John Doe
1 year ago by Michael Han