|
Contributed by Joe
|
|
Monday, 03 July 2006 |
Java VariablesThe Java programming language has built-in "primitive" data types to support integer, floating-point, boolean, and character values. These primitive types hold numeric data that is understood directly, as opposed to object types defined by programmers. The type of every java variable must be defined explicitly. The primitive data types java variable are:
boolean either TRue or false char 16-bit Unicode UTF-16 character (unsigned) byte 8-bit integer (signed) short 16-bit integer (signed) int 32-bit integer (signed) long 64-bit integer (signed) float 32-bit floating-point (IEEE 754) double 64-bit floating-point (IEEE 754) For each primitive type there is also a corresponding object type, generally termed a "wrapper" class. For example, the class Integer is the wrapper class for int. In most contexts, the language automatically converts between primitive types and objects of the wrapper class if one type is used where the other is expected. Java Variable access scopeAccess scope of instance and class variables defines what objects can read and modify that variable.The four possible visibility modifiers are: public, protected, private, and no modifier. |
|
Last Updated ( Monday, 03 July 2006 )
|