Week 1: Lab Document, 8/30
We will support the Eclipse Integrated Development Environment (IDE)
for Java programming.
The Eclipse IDE is available on all computers in the 301 MLH lab.
It is also available free for downloading onto your home computers.
I have downloaded the first item, Eclipse IDE for Java Developers,
and have been successfully using it on my home computer that runs Windows XP.
Here is a basic Eclipse Tutorial
(in powerpoint) created by your TA, Fang Wang.
Here is a sequence of simple Java programs. Run these in Eclipse, examine the output, and understand how the programs work.
- HelloWorld.java. This is the classic "simplest" program
one can write in Java. It shows you a bit of the structure of a Java program.
- PrintSquares.java. This illustrates for-loops and
simple output statements.
- ReadNumbers.java. This shows a simple example
of Java input statements.
- TwoDPoint.java. This shows how to define a class
(called TwoDPoint) and TwoDPointTest.java shows how to define and use
- RandomTest.java. This shows the use of 1-dimensional arrays
and the use of a random number generator.
Java provides a class called Random (see documentation here) that provides a number of methods that can be used to generate