September 2005
Beginner
576 pages
13h 6m
English
As stated, objects are created by using a class of objects as a guideline. The following is an example of a class:
public class Modem {
}
Any object created from this class can't do anything because it doesn't have any attributes or behavior yet. You need to add those or this class that won't be terribly useful. You could expand the class into the following:
public class Modem {
int speed;
public void displaySpeed() {
System.out.println("Speed: " + speed);
}
}
The Modem class now should be recognizable to you because it looks a lot like the programs you have written during Hours 1 through 9. The Modem class begins with a class statement, as your programs have, except that it has a public statement alongside it. The public ...
Read now
Unlock full access