- Hands-On Penetration Testing with Python
- Furqan Khan
- 154字
- 2021-07-02 14:14:00
Polymorphism with classes (abstract classes)
There may be occasions in which we would want to define a template of a class in terms of what that class must do, but not in terms of how it should do it – we would want to leave that to the implementation of the class. This is where we can make use of abstract classes. Let's create a script called Poly_class.py and add the following code:

It can be seen that we have an abstract class called Shape, which has an area method. The area method is not implemented in this class, but it would be implemented in the child class. The Square and Circle child classes override the area method. The area method is polymorphic, which means that if a square overrides it, it implements the area of a square and when a Circle class overrides it, it implements the area of a circle.
- SoapUI Cookbook
- Visual C++串口通信開發入門與編程實踐
- AWS Serverless架構:使用AWS從傳統部署方式向Serverless架構遷移
- Java Web及其框架技術
- 編寫高質量代碼:改善C程序代碼的125個建議
- 琢石成器:Windows環境下32位匯編語言程序設計
- JavaScript:Moving to ES2015
- Python算法從菜鳥到達人
- SQL Server從入門到精通(第3版)
- Node.js Design Patterns
- Python深度學習:基于TensorFlow
- C語言程序設計上機指導與習題解答(第2版)
- 新一代SDN:VMware NSX 網絡原理與實踐
- Oracle GoldenGate 12c Implementer's Guide
- SQL Server 入門很輕松(微課超值版)