uni

Thing1's amazing uni repo
Log | Files | Refs

shape-control.txt (486B)


      1 Circle circle1 = new Circle();
      2 circle1.makeVisible();
      3 circle1.moveHorizontal(50);
      4 Circle circle2 = new Circle();
      5 circle2.makeVisible();
      6 circle2.changeColor("red");
      7 
      8 String color = circle1.getColor();
      9 if (color.equals("red")) {  
     10    int currentSize = circle1.getSize();
     11    circle1.changeSize(currentSize * 2);
     12 }
     13 
     14 color = circle2.getColor();
     15 
     16 if (color.equals("red")) {
     17    int currentSize = circle2.getSize();
     18    circle2.changeSize(currentSize * 2);
     19 }
     20  
     21    
     22 
     23 
     24