CS 112a
Fall 2004
Ileana Streinu

Lecture and Lab 2
Structure of a Java applet. Introduction to Classes and Objects

Plan for next two weeks

Mostly lab-like sessions, combined with short "lectures", demos and discussions.

All these demos and exercises (and others that will be done later in the semester) are here. By reading the code and modifying existing Java applets you will start getting an understanding of the object-oriented philosophy of Java. Along the way we review basic programming techniques learned in CS1 and apply them in the context of Java.

Getting started with applets

In-class exercises: how are they helping you learn Java?

By doing these exercises, you learn:
To do:

All Exercises

Each exercise should be done in its own separate directory named as indicated (HelloWorld, Init, PaintText, etc.).

These exercises will count as part of your first and second homeworks.

You will be told, in the beginning of each lecture/lab period, how many new exercises to do, and which ones.

For today, the plan is roughly: 1 and 2 in the morning, 3, 4, 5, 6 and 7 in the afternoon (to be completed as part of the first homework.)

Click now to get to the directory of All exercises


Will ask you to create a small applet with basic action and drawing, and doing some simple computations. It is a combination of all the small exercises done in this lab. Check the homework on the class schedule page.