Next:
1.1 Introduction
Up:
Elements of Object-Oriented Program
Previous:
Elements of Object-Oriented Program
1. From C++ to Java
Subsections
1.1 Introduction
1.1.1 What is an Object?
1.1.2 Classes: Templates for Creating Objects
1.1.3 Defining Constants
1.1.4 Capitalization and Commenting Conventions
1.2 Java Data Types
1.2.1 Primitive Types
1.2.1.0.1 Numeric Constants
1.2.1.0.2 Conversions Between Types [Optional]
1.2.2 Object Types
1.3 Java Class Definitions
1.3.1 Defining Classes to Represent Compound Data
1.3.2 Constructors
1.3.3 Defining Instance Methods
1.3.4 Printing Objects
1.4 The Union and Composite Patterns
1.4.1 Member Hoisting
1.4.2 The Composite Pattern
1.4.3 Defining Instance Methods for a Composite Class
1.4.4 Conditional Statements
1.4.5 Blocks
1.4.6 Singleton Pattern
1.5 Basic Program Design
1.5.1 The Design Recipe
1.5.1.1 Data Analysis and Design
1.5.1.2 Contract and Header
1.5.1.3 Examples
1.5.1.4 Template
1.5.1.5 Body
1.5.1.6 Test
1.5.2 An Extended Example: Lists
1.5.3 Singleton Pattern
1.5.3.1 Type Predicates and Type Casts in Java
1.5.3.2 Avoiding the Use of the
instanceof
test
1.5.3.3 Maintaining Sample Test Data
1.5.3.4 A Sample Program
1.5.4 Inheritance and the Composite Pattern
1.5.4.1 Overriding
equals
1.5.5 Helper Methods, Packages, and Visibility
1.6 Using Classes to Enforce Invariants [Optional]
1.7 Interfaces
1.7.1 Multiple Inheritance
1.7.2 Implicit Polymorphism
1.7.3 Interface Types
1.8 The Command Pattern
1.8.1 Static Members of Classes
1.8.2 Complete Java Programs
1.8.2.1 A Complete Java Program
1.8.3 When to Use Static Methods
1.9 Loose Ends
1.9.1 Local variables
1.9.2 Casts and Static Type Checking
1.9.3 Exceptions as Errors
1.9.4 Name and Method Overloading
1.10 The Visitor Pattern
1.10.1 Interpreting Arithmetic Expressions
1.10.2 Openness in Data Design
1.10.3 Polymorphic Visitors
1.10.4 Polymorphic Visitors with Arguments
1.11 Unusual Situations versus Runtime Errors
1.11.1 A Motivating Example
1.11.2 Using Java Exceptions
1.11.3 Exception Handling
Corky Cartwright 2003-07-07