Wednesday, May 14, 2008

First Homework

Put answers on blog or Google document before next class (Monday). Questions on page 74.

Exercise R2.1.
Explain the difference between an object and an object reference.

Exercise R2.2.
Explain the difference between an object and an object variable.

Exercise R2.3.
Explain the difference between an object and a class.

Exercise R2.4.
Give the Java code for constructing an object of class Rectangle, and for declaring an object variable of class Rectangle.

Exercise R2.5.
Explain the difference between the = symbol in Java and in mathematics.

Exercise R2.6.
Uninitialized variables can be a serious problem. Should you always initialize every int or double variable with zero? Explain the advantages and disadvantages of such a strategy.

Exercise R2.7.
Give Java code to construct the following objects:
(a)
A rectangle with center (100, 100) and all side lengths equal to 50
(b)
A string “Hello, Dave!”
Create objects, not object variables.

Reaction to this quote

"Instead of imagining that our main task is to instruct a computer what to do, let us concentrate rather on explaining to human beings what we want a computer to do." - Donald Knuth

Think about all the attributes and methods a plant nursery would need

OO ... Object oriented.

Most important attributes and methods a plant nursery would have.

Class PlantNursery

Attributes: (String, int, or double)
cost : double

Methods:

Monday, May 12, 2008

Two assignments

Send me an email to
david.freer@gmail.com

  1. with the information whether or not you have the book
  2. what is the URL to your blog.

Use the email account that you use the most.

To install bluej

Click here and download it.

Here is the API for Java from Sun.

Welcome to Java and Object Oriented Programming

We are going to have a great semester!

First blog post: What do you hope to get out of COP2800 Introduction to Java?

Your first assignment is to read this article about classes and objects.

Thursday, May 1, 2008

Jung Typology Test

Try this out.

See what you get.