lab8 finished
This commit is contained in:
24
lab/lab8/Question3/Start.java
Normal file
24
lab/lab8/Question3/Start.java
Normal file
@@ -0,0 +1,24 @@
|
||||
/**
|
||||
* 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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user