CIS 6930-01 – Fall 2000

12/11/2000


Click here to start


Table of Contents

CIS 6930-01 – Fall 2000

Java Language Basics

Obvious similarities to C, C++

Obvious differences from C, C++

Primitive types rationalized

Three kinds of comments in Java:

Java Keywords

Java Language—Program Structure

Java Types

Primitive Types

Array Types

More on Arrays

Strings—an example of a class type

Some features of Strings.

Java Language—Expressions

Java Language—More Expressions

Java Control Flow. I: if Statements

Control Flow II: while Loop Constructs

Control Flow III: The for Loop Construct

Control Flow IV: The switch Construct

Control Flow V: break and continue

Method Definitions

The Java Object Model: Classes, Instances and Methods

The Java Object Model Overview

Defining a Class

Example: a Predefined Class

Creating a Class Instance

Using a Class

Instance Variables

Class Variables

Static and Non-static Methods

Instance Methods

Local variables

this

Static Methods

Constructors

A Better Potato

Overloading and Type Conversions

Examples of overload resolution

Header of Class Definition—Details

Modifiers of Classes

Modifiers of Fields

Modifiers of Methods

The Java Object Model: Inheritance and the Class Hierarchy

Some Dependencies between Classes

Inheritance

Trivial use of Inheritance

A Limited Kind of Polymorphism

Class Hierarchies

Inheritance with Overriding

True Polymorphism

Runtime Lookup of Methods

Runtime Lookup with Overriding.

Inherited Methods and Overriding

Abstract Methods and Classes

Final Methods and Classes

Protected Access

The Universal Superclass—Object

Methods on the Object class

Reference Conversions

Using Vector

Widening Conversions on Arrays

Overloading with Inheritance

Overload Resolution across Classes

Summary: Overloading vs. Overriding

Constructors and Inheritance

Superclass Constructor Invocation

Exceptions

Exceptions are Pervasive

Exception Objects, and throw

throw compared with break

Methods that throw exceptions

Exception Handling in Nested Calls

Example using java.io

How (not) to Ignore an Exception

Part of the Exception Hierarchy

Unchecked Exceptions

Defining you own Exceptions

Interfaces

Abstract Classes Revisited

Interfaces

Implementing an interface

An Interface is a Contract

An Interface Defines a Type

Classes can Implement Several Interfaces

Interfaces can Extend other Interfaces

Interfaces can hold Constant Definitions

Interfaces can be used as Markers

Summary

Packages

Packages

Packages and Directory Structure (JDK)

Hierarchical Package Names

Fully Qualified Class Names

Import statements

CLASSPATH

Java System Packages, I

Java System Packages, II

Additional Java 1.2 System Packages

Further information

Author: Neil Jasper

Email: dbc@csit.fsu.edu

Home Page: http://aspen.csit.fsu.edu/it1fall00