Computer Science 112:

Introduction to Computer Science II

Gregory M. Kapfhammer

flickr photo shared by Billboard Art Project under a Creative Commons ( BY-NC-ND ) license

Color Scheme

Key Concept

Corresponding Diagram

In-Class Discussion

In-Class Activity

Details in the Textbook

Object-Oriented Design

Goals: robustness, adaptability, reusability

Principles: abstract, encapsulation, modularity

Terms: polymorphism, inheritance, encapsulation

Any questions about these key points?

Interfaces and abstract classes

Exception Handling

What could go wrong?

File system problems

Network problems

Write a Java program that divides a variable by zero!

How to Handle?

Do not handle the exception

Handle the exception where it occurs

Handle the exception somewhere else in the program

What are the trade-offs of these solutions?

Uncaught exceptions

Caught Exceptions

How are these types of exceptions similar and different?

Try-Catch Statements

Casting and Generics

Why are generics important?

Nested Classes

Why are nested classes important?

Any questions about object-oriented design?