Java Notes

Java Notes

Introduction

This page describes how much you remember with different modes of interaction, problem solving, giving precise instructions

The Basics:

Example programs to find out how much you weigh on other planets. See a handout [doc] of the first few examples all in one file:

  1. Version 1: A simple program, comments, semicolon, output

  2. Version 2: Variables, assignment, arithmetic, string concatenation

  3. Version 3: Precedence, parenthesis, type cast, named constants

  4. Scanner Class: Simple form of Input/Output (I/O)

  5. Output using Strings. (For more see also the CFX Strings examples)

  6. Other [you can skip this - it is included for historical reasons]

    1. Before the Scanner class you used to have to use Console IO

    2. Alternate kinds of input for the Planet weights program

Decisions and Looping

Objects and Classes

Arrays, Recursion, Linked Lists

Advanced Topics

  1. Inheritance: Creating a hierarchy of classes that selectively share date and operations

  2. Interfaces: A "contract" with the outside world for a class to have certain methods defined.

  3. Mouse Input requires us to implement a Java Interface.

Java Reference

Download Java

Download Java first before trying to download Eclipse in the step below. As a Java developer, you will want the latest version of the Java Development Kit (JDK), which includes the Java Run-Time Environment (JRE) version.

As of 1/9/2012, the Java downloads page looks like:

Select the JDK version shown highlighted in green above. This will take you to the downloads page for the JDK:

Mac users you may already have Java installed on your computer. If not, follow the link highlighted in blue above. For windows users, choose the appropriate version highlighted in green above.

Download Eclipse

This is a nice Integrated Development Environment (IDE). For Eclipse, download the latest version from:

http://www.eclipse.org/downloads/

As of 1/9/2012, selecting "Eclipse IDE for Java Developers" will take you to the following window:

Select the version (shown in the red box above) that is appropriate for your environment.

Online Java Books and Tutorials

Other Java links

[UIC] [CS Dept] [Reed] [CS102] [CS107]