• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Lesson 7. Creating Custom Classes > Understanding Inheritance

Understanding Inheritance

A class can gain (inherit) all members from another class. This is called inheritance. The class that's gaining the members is called a subclass and the class from which it inherits is called the superclass. If B is a subclass of A, B is said to extend A.

Inheritance promotes code reusability. It allows you to give functionality to other classes without having to rewrite code that would be redundant. This concept will \be much clearer by the end of this lesson.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint