Recall the Rectangle and Cube classes discussed earlier, as shown in Figure 11-18.
Figure 11-18: Rectangle and Cube classes

a) Is the following statement legal or illegal? If it is illegal, why?
Rectangle r = new Cube(10, 12, 5);b) If you determined that the statement in part a is legal, ate the following statements legal or illegal? (Indicate legal or illegal for each statement.)
System.out.printIn(r.getLength());System-out.println(r.getWidth());System.out.printIn(r.getHeight());System.out.println(r.getSurfaceArea());c) Is the following statement legal or illegal? If it is illegal, why?
Cube c = new Rectangle(10, 12);
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.