Home : Course Map : Chapter 4 : Java :
Summary of Classes and Objects
JavaTech
Course Map
Chapter 4

Introduction
Inheritance
  Demo 1
Overriding
  Demo 2a
  Demo 2b
this,super
MoreConstructors
  Demo 3
Abstraction
Interface 
  Demo 4
Casting References
MoreAboutArrays
Object class
Class Summary
Exercises

    Supplements
Override/Overload
Annotation-J2SE5.0
Java Security
Class Loading
Class Verifier
SecurityManager
     About JavaTech
     Codes List
     Exercises
     Feedback
     References
     Resources
     Tips
     Topic Index
     Course Guide
     What's New

We began our presentation of class and objects in Chapter 3 with descriptions of the following essential elements:

  • A Class definition describes the attributes of a new data type that is implemented at the source code level.

  • The basic parts of class definition are its
  • The instantiation process, also referred to as the creation of an object, provides memory for the data fields and assigns to that data a unique identification. This unique set of data represents a single instance of the class.

  • An object is accessed via a reference variable. The data is accessed and methods are invoked via the dot "." operator.

  • When a object's method is invoked, its data is used with the method code. When the same method for another object of the same class is invoked, then that object's data is used with the code.

  • The static modifer means that a data field or a method can be used even if no instance of that class is instantiated. Only one memory location is assigned to a static data field.

  • Overloading allows for methods with the same name but different argument lists.

Chapter 4 then describes how a class can be built upon to create new classes:

  • Inheritance allows a new class to incorporated the code from another class and to create additional data fields and methods.

  • Overrriding of a method allows for a new definition of a method from that in the super class.

  • An abstract class provides the essential description of a general type but subclasses must add the data and methods that describe specific types.

  • Polymorphism allows subclass instances to be treated as instances of a base class. This is a very powerful generalisation technique that we will use frequently.

  • All Java classes extend the Object class so all objects can be treated as instances of Object.

  • In Java an interface is a completely abstract class that allows for multiple implementations.

If you find that object oriented programming (OOP) remains somewhat vague, your understanding of the concepts involved will deepen as you see and use OOP techniques in coming chapters as we apply OOP to graphics, threading, I/O, and other areas.

We return to class structure, design, and analysis in Chapter 16 where we give a brief overview of the Unified Modeling Language (UML). UML provides a systematic approach to the design of classes and to analysis of the interactions among objects. We then use UML to design a set of classes for a distributed computing example.

References & Web Resources

Latest update: Oct.20, 2004

            Tech
MoreComplexClass
ImprovedHistogram
JavaRandomNums
Vectors & Matrices
Exercises

           Physics
Runge-Kutta 2nd
  Demo 1
Runge-Kutta 4th
  Demo 2
BoundaryVal.Prob
Shooting Method
  Demo 3
Exercises

  Part I Part II Part III
Java Core 1  2  3  4  5  6  7  8  9  10  11  12 13 14 15 16 17
18 19 20
21
22 23 24
Supplements

1  2  3  4  5  6  7  8  9  10  11  12

Tech 1  2  3  4  5  6  7  8  9  10  11  12
Physics 1  2  3  4  5  6  7  8  9  10  11  12

Java is a trademark of Sun Microsystems, Inc.