25 lines
677 B
Java
25 lines
677 B
Java
/**
|
|
* Answers the question.
|
|
*
|
|
* Question3:
|
|
*
|
|
* - Q: What is the problem with the resize method of the Shape calss? How do
|
|
* you solve this problem?
|
|
*
|
|
* - A: The resize method of the Dot class is inherited from the Shape class.
|
|
* which does not have a throw Exception declared. We can solve this problem by
|
|
* declaring the resize method in the Shape class as a throw Exception.
|
|
*
|
|
* - Q: Do you need to change the resize method of the Circle class then?
|
|
*
|
|
* - A: No, we do not need to change the resize method of the Circle class.
|
|
*/
|
|
|
|
public class Start {
|
|
public static void main(String[] args) {
|
|
Shape.testShape();
|
|
Circle.testCircle();
|
|
Dot.testDot();
|
|
}
|
|
}
|