ABSTRACT

The purpose of this chapter is to cover the concept of identifiers and variables in Java. The distinction between identifiers and variables is one of the biggest differences between languages that implement data types for runtime objects (such as Smalltalk and Java) and those that only use data types at compile time to generate runtime executable code to manipulate those objects (such as C/C++ and Ada). This distinction helps to account for the fact that, although the syntax of Java and C++ are similar, programming in the two languages feels very different. Objects are handled very differently at runtime, which impacts how objects are manipulated in the language in general. Understanding how Java treats objects will be important in subsequent chapters, when objects are passed between other objects or even around a network using tools such as RMI. Being aware of the nature of objects at compile time and runtime is also important in understanding the concept of an interface, which does not define any data or behavior for an object but simply what messages an object must accept.