4.5 Data Definitions


4.5 Data Definitions

Data definitions appear in the classes as attribute declarations. Similar data definitions appear within the functions (or methods); these are known as local data declarations. There are two general types of data definitions:

  • Declarations of simple variables

  • Declarations of object variables, also known as object references

Simple variables are those of simple or primitive types; these store small and simple data items like integer values, floating-point values, and others. Object variables (or object references) are variables that can store the reference to objects when they are created. The only way to manipulate objects is by using their references, because in Java and KJP objects do not have an identifier directly associated with them.




Object-Oriented Programming(c) From Problem Solving to Java
Object-Oriented Programming (From Problem Solving to JAVA) (Charles River Media Programming)
ISBN: 1584502878
EAN: 2147483647
Year: 2005
Pages: 184

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net