import java.awt.*; abstract class Kujund{ double x, y, dx, dy; public abstract void joonista(Graphics g); public final int TABAMISKAUGUS=20; public abstract boolean kasPihtas(int hx, int hy); public void muudaAsukoht(int ux, int uy){ x=ux; y=uy; } public void muudaKiiruseSamm(double udx, double udy){ dx=udx; dy=udy; } public void liigu(){x+=dx; y+=dy;} public int kysiX(){return (int)x;} public int kysiY(){return (int)y;} }