not sure exactly on how many files to make any help on suggestions would be grea
ID: 3646887 • Letter: N
Question
not sure exactly on how many files to make any help on suggestions would be great or guidespublic interface Colorable {
public void howToColor ();
}//Interface Colorable end
public class GeometricObject {
public GeometricObject () {
}//Cconstructor end
} //class GeometricObject end
import javax.swing.JOptionPane;
public class Square extends GeometricObject implements Colorable {
public Square () {
}//Square end
public void howToColor () {
JOptionPane.showMessageDialog(null, "Color all four sides!");
} // howToColor end
} class howToColor End
//TEst Program
import javax.swing.JOptionPane;
public class TestColorableObject {
public static void main(String[] args) {
GeometricObject[] objects = new GeometricObject[5];
objects[0] = new Square();
objects[1] = new GeometricObject();
objects[2] = new Square();
objects[3] = new GeometricObject();
objects[4] = new Square();
for (int i = 0; i < objects.length; i++) {
GeometricObject object = objects[i];
JOptionPane.showMessageDialog(null, "Object [ " + i + " ] ");
if (object instanceof Colorable) {
Colorable colorable = (Colorable) object;
colorable.howToColor();
}else {
JOptionPane.showMessageDialog(null, " NOT COLORABLE!");
} //end else
} //end for
}