Lecture Notes, class 6 for csc211.

Prepared by: Anthony Larrain

These notes serve as an outline to the lecture, they are not intended to be complete. You should be reading the assigned sections. During class I may include or omit certain topics.


Classes

Recall all Java programs are built from classes.

In Java a class is used in several way's.


Defining Classes to Create Objects.

Write a class that can be used to create Bicycle objects. Note: the state (data) and operations (methods) are determined by the application that will use Bike objects.


Features of class Bicycle


Three Types of Variables


Stack and the Heap


The Circle Class

UML diagram of a Circle Class

Look at the driver class first


The PairOfDice Class

UML diagram of a PairOfDice Class

Look at the driver class first


The BankAccount Class

UML diagram of a BanakAccount Class

Look at BankAccountDriver.java first to see how the class is used then look at BankAcount.java


Word Guess Game

Write a program that plays a simple word scramble game with the user. The program will select a word from a list of words. All I/O will be done using the Standard Input using Scanner Class and Standard Output, using System.out.