Recall the Rectangle and cube classes discussed carlicr, as shown in Figure $10-18$
a) Is the following starement legal or illegal? If is is illegal, why?
Rectangle $x=$ new Cube (10,12,5)
b) If you determined that the statement in part a is legal, are the following statements legal or illcgal? (Indicate legal or illcgal for cach statement.) Syatem . OUt . Println ( $x$. gettength () ) System.out $.$ print 1 n $(x, \text { getwidth }())$ System . OUt . print $1 n(x . \text { get } \text { Helght }())$ Syatem.out $\cdot$ print $1 n(x \cdot \text { getsurtacentea }())$
c) Is the following statement legal or illegal? If it is illegal, why?
Cube $e$ - new Rectangle (10,12) ?