Java Programming

[Background]
[Basics] (Hello World, IO, methods, types, arrays, objects, Inheritance, dynamic dispatch)
[More Java Features] (Interfaces, Exceptions, Swing GUIs, Applet, Collections, Graphics, Help API)
[GUI Builder] (tutorials using NetBeans)
[New features of Java 5]
[C++ / Java Comparison] (addresses, pointers, classes)

The assumption here is that you are already a proficient C/C++ programmer. Much of the information below is taken from Sun's Java tutorial site (indicated as sun.com). Other examples are taken from the CFX examples repository (indicated as CFX, see also a static version, or browse the examples directory). See the source code for the Horton Java book, or this local copy.

Background

Java is both a Language and a Platform (sun.com) (compiler, interpreter, jvm)
Java programs can be standalone applications, web-based applications, or web browser-based applets (see examples from sun.com)
As in C++, Java programs are made up of classes (CFX). (See illustration of creating classes using BlueJ)

Basics of the Language

These examples assume you already know a language such as C++. See Sun's introductory Java tutorial path.

More Java Features

GUI Builder

New Features of Java 5

Sun has a description of new features in Java 5 (a.k.a. Java 1.5).

These features include generic types (like C++ templates), autoboxing (e.g. auto conversion to base types of objects stored in ArrayList), an enhanced for loop making it easier to iterate through Collections, enumerated types, static import, C style formatted input/output, and variable arguments.

On the CS lab machines, Java 5 is found at:
       /usr/java/jdk1.5.0/

Comparison of Java with C++

See this comparison that addresses, pointers, classes, and other differences.

[CS Dept.] [UIC] [Prof. Reed]