Students in CIT-130 at West Hills center signed up for a class in the Java API.

Inheritance hierarchies and the Java API

This module guides students through an inheritance focused journey into the bowels of a single class in the Java library. A visual depiction of the class's family will accompany a sample program demonstrating its juiciest bits.


check_boxLearning Objectives
bookModule resources & links
wb_incandescentProject specifications
wb_incandescentProposed project phases
wb_incandescentSharing guide

check_boxLearning Objectives

  1. Trace the lineage (family origin) of all methods and member variables in a java.util package class using graphic representations
  2. Master reading the Java API documentation by using nothing but the doc to make calls and usefully process the result of calls to methods on the chosen class
  3. Create an object-relationship diagram depicting the components involved in the sample program

arrow_upward top

bookExternal Resources

java.util classes in the Java 8 API Documentation

Oracle's online Java tutorials on Inheritance and Interfaces

Class diagramming guide google docs extension for diagramming all manner of things, including Java classes

arrow_upward top

bookProject specification

Coding to a specification creates creative/engineering bounds that do a brain good when learning a skill. Study these specs, write your code to meet its criteria, and test ruthlessly. You may renegotiate the specs at any time with the help of your fearless instructor.


Demonstrate foundational competence related to Java's inheritance mechanisms and practice the skill of learning a Class through the API documentation alone.


Study the API

Study the API documentation for your chosen Collections class fiercely by diagramming the class itself, including all important methods and member variables.

Dissect the class hierarchy located at the to of the Class API page and the section titled All Implemented Interfaces. Create a draft class inheritance chart as you read. We're going to draft this!

Research examples

Look up your class in the Liang 9's chapter 22. TYpe in any relevant sample programs and get them running.

Research examples of use

Search Stack Overflow for instances in which somebody else has used your class. Make a note

Diagram the classes

Using the Wikipedia page on class diagramming as a guide, create a final draft of your class diagram. Make it big and interesting enough that we can post it on the wall for others to reference in the future.

program structure

Setup NetBeans

Build this entire project in its own NetBeans package, such that after you push this directory to GitHub, others can grab the whole configuration settings and test your program directly.

Blueprint class

Design a class without a main method that cleverly builds a tool around the functions of your chosen class. Remember, you're creating a class that will be instantiated by a client class. (e.g. we instantiated Donut objects in our client class DonutLand.). Name this class appropriately.

Test ruthlessly

Design a client class that contains a main method which immediately delegates to another method the responsibility for testing your Object instantiating your class and showing off its nifty methods.


Your program should carry out the following general tasks which you shall implement using code that harnesses the power of your chosen class.

  1. Create and store instances of your computer history timeline object set in your Collections data structure.
  2. Call at least TEN (10!) different methods that are located directly on your chosen class. Choose methods that are central to the class's function. Make note in comments what each method does and why it might be useful if not already obvious.
  3. Call TWO(2) methods on your object that it inherited from its ancestor the Object object. You'll want to steer clear of the thread-based methods for now unless you're exceptionally ambitious.
  4. If your chosen class or its superclass contains one or more member variables, show its use in one of your methods.

deliverable checklist

The value of your work is related to how easily others can learn from it in the future. As such, take your time in satisfying each of these sharing guidelines.

  1. Refactor your code as needed to make its workings clear to a reader. Comment your code where the names of variables and methods are not "self-commenting". Make specific note in your comments when a method is called on your class of interest.
  2. Capture a screen shot of your program working. Name it appropriately. Save it in an appropriately name directory inside your NetBeans project.
  3. Finalize your visually appealing class hierarchy diagram you did in planning for your program. Mount this diagram on colored wall paper and attach to an existing banner or make a new one.
  4. Scan or photograph any notes or planning documents to also include in your repository.
  5. Write a one-page expansion guide for future students who would like to continue building your application. Make a bulleted list with ideas--being as specific as you can such that a future student of intermediate skill level could continue your work.
  6. Push the entire NetBeans project to your course Repo. Include a readme describing how somebody would run your code, and why they might ever want to do so.
  7. Record your work in our submission spreadsheet Include a readme describing how somebody would run your code, and why they might ever want to do so.

arrow_upward top

Page created in 2018 and can be freely reproduced according to the site's copyleft use agreement.