Advertisement
Guest User

Untitled

a guest
Oct 25th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. public class main {
  2.  
  3. /**
  4. * @param args
  5. */
  6. public static void main(String[] args) {
  7. // create some shape instances
  8. shape shapes[] = new shape[2];
  9. shapes[0] = new Rectangle(10, 20, 5, 6);
  10. shapes[1] = new Ellipse(30, 40, 12, 6);
  11. for (int i = 0; i < shapes.length; i++) {
  12. shapes[i].draw();
  13. shapes[i].shapeMoveTo(100, 100);
  14. }
  15.  
  16. }
  17.  
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement