we have learned how to assign a class as the subclass to another class and that we could add methods and attributes to specialize such subclass. A subclass could access the superclass method but the superclass method could also be override and extend.
In addition, when the object returned are not the result we expected, we should raise an exception. We could build the exception in a class and raise it when need. There are many existing exceptions such as ValueError, ZeroDivisionError. The inheritance of the exception class is also very important.
No comments:
Post a Comment