Cir cir = new Cir();
Rec rec = new Rec();
Tri tri = new Tri();
canvas.addFigure(cir);
abstract class Figure{
abstract boolean overPeriphery();
abstract void clicked();
abstract void display();
}
int x,y;
ArrayList<Figure> fig;
x = xpos;
y = ypos;
}
void addFigure(Figure f){
fig.add(f);
}
void display(){
/*
for(int i = 0; i < fig.size(); i++){
fig.display();
}
*/
for(Iterator it
= fig.
iterator() ; it.
hasNext(); ){ it.display();
}
}
}
Q2FudmFzIGNhbnZhczsKQ2lyIGNpciA9IG5ldyBDaXIoKTsKUmVjIHJlYyA9IG5ldyBSZWMoKTsKVHJpIHRyaSA9IG5ldyBUcmkoKTsKCgpjYW52YXMuYWRkRmlndXJlKGNpcik7CgphYnN0cmFjdCBjbGFzcyBGaWd1cmV7CiAgYWJzdHJhY3QgYm9vbGVhbiBvdmVyUGVyaXBoZXJ5KCk7CiAgYWJzdHJhY3Qgdm9pZCBjbGlja2VkKCk7CiAgYWJzdHJhY3QgIHZvaWQgZGlzcGxheSgpOwp9CgpjbGFzcyBDYW52YXN7CiAgaW50IHgseTsKICBBcnJheUxpc3Q8RmlndXJlPiBmaWc7CiAgQ2FudmFzKGludCB4cG9zLCBpbnQgeXBvcyl7CiAgICB4ID0geHBvczsKICAgIHkgPSB5cG9zOwogIH0KICAKICB2b2lkIGFkZEZpZ3VyZShGaWd1cmUgZil7CiAgICBmaWcuYWRkKGYpOwogIH0KICAKICB2b2lkIGRpc3BsYXkoKXsKICAgIC8qCiAgICBmb3IoaW50IGkgPSAwOyBpIDwgZmlnLnNpemUoKTsgaSsrKXsKICAgICAgZmlnLmRpc3BsYXkoKTsKICAgIH0KICAgICovCiAgICBmb3IoSXRlcmF0b3IgaXQgPSBmaWcuaXRlcmF0b3IoKSA7IGl0Lmhhc05leHQoKTsgKXsKICAgICAgaXQuZGlzcGxheSgpOwogICAgfQogIH0KfQ==
Main.java:1: class, interface, or enum expected
Canvas canvas;
^
Main.java:2: class, interface, or enum expected
Cir cir = new Cir();
^
Main.java:3: class, interface, or enum expected
Rec rec = new Rec();
^
Main.java:4: class, interface, or enum expected
Tri tri = new Tri();
^
Main.java:7: class, interface, or enum expected
canvas.addFigure(cir);
^
5 errors