HELP! * GREY=local LOCAL HTML version of Foils prepared January 8,96
Foil 34 Declaration of Class Point:
From Overview of Java SC95 Tutorial on Web Technologies -- December 4,95. byNPAC Team * See also color IMAGE
public class Point implements Movable
{ float x, y;
public Point(float x, float y) {
this.x = x;
this.y = y; }
public Point() {
x = Movable.x;
y = Movable.y; }
private float clip(float x) {
if(x < 0.0) return 0.0;
if(x > 1.0) return 1.0;
return x; }
public void move(float dx, float dy) {
x = clip(x + dx);
y = clip(y + dy); }
public void move() {
x = Movable.x;
y = Movable.y; }
} // end class Point
Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.