Java Objects and Classes
William Johnston Buchanan · 1998
C++ added object-oriented programming onto C. This allows the language to contain non object-oriented code and object-oriented code. Java differs in that it is completely object-oriented. This chapter discusses the main parts of object-oriented design, that is: Classes. This is a collection of data and methods that operate on the data. Objects. This is a created instance of a class which contains its own class data. Methods. These are used to operate on objects and are equivalent to procedures (in Pascal) and functions (in C). Constructors. These are used to initialise an instance of a class. Method overloading. These are used to define a method which has different parameters passed to it. Garbage collection. This is used to clean-up unused objects.