Every time you do not need to start from scratch to model a class. Instead, you can consider an existing class and make a specialized version of it using inheritance. The primary aim of inheritance is to promote reusability and eliminate redundancy in code. It also shows how a child class can get the features (or characteristics) of its parent class. This chapter focuses on this topic.

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Inheritance

  • Vaskaran Sarcar

摘要

Every time you do not need to start from scratch to model a class. Instead, you can consider an existing class and make a specialized version of it using inheritance. The primary aim of inheritance is to promote reusability and eliminate redundancy in code. It also shows how a child class can get the features (or characteristics) of its parent class. This chapter focuses on this topic.