course mod topic first name date completed
cit-244 wk. 3 abstract classes and interfaces
java master sequence > abstract classes and interfaces

Abstract classes and interfaces: Ch. 15

Use cases for "plain" inhertiance: subclass extending a super class

Use cases for abstract methods (which make for abstract classes)

Use cases for interfaces

key points

Computers are multi-purpose electronic devices which can carry out instructions to accomplish a variety of unrelated tasks

program specification

This is a motorcycleExercise 1: "Might we be friends?" flowcharting activity paragraph

This is a paragraph

  1. CIT-111: Introduction to programming with Java
  2. CIT-230: Object-oriented programming 1
  3. CIT-244: Object-oriented programming 2

Instructor Eric Darsow's implementation of this course sequence is offered at CCAC's West Hills Center in the Spring of 2019.

CIT-111: Introduction to Programming

The following table maps course session dates, lesson topics, LIANG9 references, and content links for all three Java courses in the series.

Abstract class inheritance project

program objective

Demonstrate the value of creating an abstract superclass, forcing sublcasses to implement all abstract methods of its parent

program requirement 1

We modeled abstract classes and inheritance trees using the Computer top-level class. To test our knowledge and build out our modeling program, create a second inheritance hierarchy whose top-level class is User. Its subclasses should include at least an AdminUser and a PublicUser. Create a handful of meaningful member variables for each super and subclass.

program requirement 2

Refactor your Computer class to include two methods, each typed to one of the subclasses of User. For example, create a method called changeAdminSettings(AdminUser us) which simulates an administrator changing a system configuration switch somehow. Similarly, create a method like lookUpUnrestrictedData(PublicUser pubus) which simulates some trivial retrieval of some database data.

program requirement 3

Create an interface called something like Authenticatable that specifies methods called String getPassword() and String getUserName(). Write companion methods on your Computer class or subclasses which accepts Authenticatable objects and simulates asking them for a username and password and pretends to check against a database.