Primitive Types and Values
NumericType:IntegralTypeFloatingPointType
IntegralType: one ofbyte short int long char
FloatingPointType: one offloat double
- A primitive type is predefined by the Java programming language and named by its reserved keyword
NumericType:IntegralTypeFloatingPointType
IntegralType: one ofbyte short int long char
FloatingPointType: one offloat double
- Primitive values do not share state with other primitive values.
- A variable whose type is a primitive type always holds a primitive value of that same type.
- The value of a variable of primitive type can be changed only by assignment operations on that variable and decrement operator.
- The numeric types are the integral types and the floating-point types.
- The integral types are byte, short, int, and long, whose values are 8-bit,16-bit, 32-bit and 64-bit signed two’s-complement integers, respectively, andchar, whose values are 16-bit unsigned integers representing UTF-16 code units.
- The floating-point types are float, whose values include the 32-bit IEEE 754
floating-point numbers, and double, whose values include the 64-bit IEEE 754
floating-point numbers. - The boolean type has exactly two values: true and false.
0 comments:
Post a Comment