0

I am student currently studying for a Computer Science exam and I have a question about casting. Here is a picture of the questions: enter image description here

I understand a - c, but I am not sure how to do part d. Any help you can offer would be greatly appreciated. I do not understand how to do this particular question. Thank you in advance.

Biggytiny
  • 519
  • 10
  • 29
  • What don't you understand? Do you know what casting is? – Sotirios Delimanolis May 27 '15 at 00:20
  • There is a problem with (d). Is that code in a client class? If so, the state variable radius should be marked private. If it is visible, you need to cast `s` to be of `Sphere` type; `System.out.println( ((Sphere)s).radius)`; – ncmathsadist May 27 '15 at 00:26

0 Answers0