There could be certain things which all shapes inherit, for example the location and color of the shape. In that case you have to use an abstract class because there would be object members defined...
Type: Posts; User: helloworld922
There could be certain things which all shapes inherit, for example the location and color of the shape. In that case you have to use an abstract class because there would be object members defined...
Yes, but it involves using the Java Reflection API.
There are 2 problems with using the Reflection API:
1. You will have very little compile-time warnings and errors that something is wrong.
2....
Take this example:
You have a base class called shape. Let's say this class is used to compute the area of multiple different subclasses of shapes. How would you even begin to compute the area of...