Tom Kelliher, CS 116
Sept. 4, 2000
Workload discussion (Section 1).
Handout: the twelve recurring concepts.
Study Section 1.5 and the lab handout.
Introduction, background.
Lab 1.


<HTML>
<HEAD>
<TITLE>
Hello World Java Applet
</TITLE>
</HEAD>
<BODY>
Here's my applet...
<HR>
<APPLET code="Hello.class"
width=150
height=60>
</APPLET>
<HR>
</BODY>
</HTML>
import java.applet.*;
import java.awt.*;
// The Hello class simply displays the string "Hello, world!"
// within the graphics object.
public class Hello extends Applet
{
public void paint(Graphics g)
{
g.drawString("Hello, world!", 20, 10);
}
}
Run the applet.
Basic, Pascal, C.
Control flow model. Flowcharting, pseudo-code.
So, objects also have (unique) names.
extends, although we're really
limiting the scope of the class. Also: binding, because we're
adding detail.
import statement. What concept(s)?
Suppose we want to model cars: Tauruses, Civics, etc.
Can we find a hierarchy of classes? (Inheritance) (Start with vehicle.)
Demonstration: