[Instructions] [Search] [Current] [Syllabus] [Links] [Handouts] [Outlines] [Labs] [More Labs] [Assignments] [Quizzes] [Examples] [Book] [Tutorial] [API]
Back to When Things Go Wrong. On to Java's Abstract Windowing Toolkit.
Held Tuesday, February 9
Summary
Contents
Handouts
Notes
DrawableObject class
and refine that to particular drawable objects, such as Circle
or Square.
extends keyword.
public class Circle
extends DrawableObject {
...
} // Circle
DrawableObject obj = new Circle();
public void drawWithStrangeColors(DrawableObject obj) {
...
} // drawWithStrangeColors(DrawableObject)
...
drawWithStrangeColors(new Circle());
extends clause,
Java assumes that your object extends java.lang.Object.
Number agree to provide
a set of drawing routines.
Line objects, which
would most likely be a subclass of Polygon (or some
such) would also provide "mathematical" operations (so that you
could add, subtract, and compare lines).
interface instead of class.
implements keyword,
as in
public class Complex
implements Drawable {
...
} // Complex
Drawable d = new Complex();
History
Back to When Things Go Wrong. On to Java's Abstract Windowing Toolkit.
[Instructions] [Search] [Current] [Syllabus] [Links] [Handouts] [Outlines] [Labs] [More Labs] [Assignments] [Quizzes] [Examples] [Book] [Tutorial] [API]
Disclaimer Often, these pages were created "on the fly" with little, if any, proofreading. Any or all of the information on the pages may be incorrect. Please contact me if you notice errors.
This page may be found at http://www.math.grin.edu/~rebelsky/Courses/CS152/99S/Outlines/outline.10.html
Source text last modified Fri Mar 12 13:07:38 1999.
This page generated on Fri Mar 12 13:12:26 1999 by SiteWeaver. Validate this page's HTML.
Contact our webmaster at rebelsky@math.grin.edu