Java -- The Language

By Greg J. Badros


These are slides from my lectures in CSE 341, undergraduate programming languages, at the Unviersity of Washington, Spring 1998. The target audience has a reasonably strong background in C++, familiarity with Smalltalk, and some experience with object oriented design. Throughout the slides, I compare and contrast Java, C++, and Smalltalk as I explain the Java language.

Click here to start

Table of Contents


Java: A Timeline

Java: The Language

Hello World!

Java vs. C++

Unlike C++, Java has….

Brewing Java

Java vs. Smalltalk

Unlike Smalltalk, Java...

Java vs. C++, Revisited

Java’s Hybrid Object Model

Java’s Class Hierarchy

Java Documentation

HelloWorld Applet

Running the HelloWorld Applet

Methods: A Closer Look

More on Methods

Default Arguments

“Override” vs. “Overload”

Java’s Class Hierarchy

What can an Object do for you today?

Objects and Identities

Cloning Objects

Changing a Ball

Inequality in Balls!

Assignment just changes the pointer

Java variables hold...



import statement

How Java Finds a Class...

Compilation of Source File

Class Access Protection

Not even friends can touch Java’s private parts

Java Accessibility vs. C++

No Need for Forward Declarations

Final Fields

Ball and CBall Example

Inheritance Mechanisms

Java Interfaces

Bounceable Interface

Ball Example Output and Errors

Types vs. Classes

Multiple Inheritance in Java

Abstract Methods and Abstract Classes

Final Methods

Final Classes

try { throw } and catch, finally (exceptions)

Exception Hierarchy


Summary: What Java Left Out from C++

Summary: What Java Put In (vs. C++)

Author: Greg J. Badros


Home Page:

Download presentation as postscript

Download 6-up handouts as postscript