Study of Java

Our reference here is the Java Language Specification, 3rd Edition. Part of the goal of this lecture is for you to gain expertise in "spec reading". Some of the examples below are taken from the Java spec.

Subtyping

Inner Classes

Lets start with reviewing what FbOB had in this area: Java inner classes give much but not all of the FbOB functionality. We will go through the inner classes specification and look at some of the crufty issues, e.g.

Generics

Generics are Java's version of parametric types. These notes assume familiarity with them; read a tutorial if you are not. Here are some comparisons with the Caml-style parametric types that we studied:

Bounded subtyping

To get around this weakness, Java 5 adds bounded subtyping

Method Overloading

The take-home message here is brief:

Constructors

Immutable Data

One of the key lessons of Caml is the importance of known immutable data: it has universal meaning.

Public/Private/package protected/Protected

Compare this with Caml modules.

Concurrency

See the concurrency lecture notes for this topic.

Other issues of comparison between Java and Caml / Fb family of languages



Last modified: Mon Apr 20 13:29:14 EDT 2009