CSC 121: Computer Science I, Spring 2005
In-Class Exercise: Introduction to BlueJ
- Goals:
- To understand the difference between classes and objects; To
use the BlueJ programming environment
- Getting started:
- Copy the folder Shapes from the public folder on the I: drive
to your personal folder on the I: drive.
Start up BlueJ.
- Open the Shapes project in your personal folder.
- Work through exercises 1.1-1.8 in your textbook reading the
text and testing any code that you write by invoking the
appropriate methods. Write answers to each of the questions.
- Open the class editor in turn for each of Circle, Square and
Triangle. Note that each description begins with text similar to:
public class Classname
{
private int apple;
private int baker;
private int charlie;
private String dog;
private boolean isVisible;
. . . .
The first line (above) names the class and the following lines name
the attributes (fields) used to describe the class.
- Write the names of the fields for each of the classes named
Circle, Square and Triangle in the Shapes project.
- Close the Shapes project, exit BlueJ, and log out.
- Turn in your answers (with your name) to all of the above.
DePauw University, Computer Science
Department, Spring 2005
Maintained by Brian
Howard (bhoward@depauw.edu
).
Last updated