+ 1
How to access getradius method in this code
2 Answers
+ 2
Your Geometry class does not have a getradius method, however its subclasses do have.
Since you have an array of Geometry, you need to cast the element to its proper type before you can access this method.
Circle c = (Circle) obj[0];
System.out.println(c.getradius());
+ 1
Tq so much đđ