()
| 26 | "] dim[" + dimension + "]\n"; |
| 27 | } |
| 28 | public static Shape randomFactory() { |
| 29 | int xVal = rand.nextInt(100); |
| 30 | int yVal = rand.nextInt(100); |
| 31 | int dim = rand.nextInt(100); |
| 32 | switch(counter++ % 3) { |
| 33 | default: |
| 34 | case 0: return new Circle(xVal, yVal, dim); |
| 35 | case 1: return new Square(xVal, yVal, dim); |
| 36 | case 2: return new Line(xVal, yVal, dim); |
| 37 | } |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | class Circle extends Shape { |