Answer the following questions about how objects work, using this chapter and explorations on the Web.
1. What is inheritance?
2. What is a super class?
3. What is a sub class?
4. What methods does a child class inherit?
5. What instance variables (fields) does a child class inherit?
1. Inheritance is a feature of object oriented programming in which certain classes can inherit data and behavior from a “parent” class. They also allow for instant polymorphism.
2. The super class is the class from which another class inherits.
3. The sub class is the class that inherits from a super class.
4. In Java, a subclass inherits all of the public and protected members of its parent (those that specifically make use of those specialized words in their definition). In Python, a subclass inherits all of the members from its parent class.
5. (Same answer as the above)
You might also like to view...
Which of the following Internet connection types is probably going to use a coaxial connector?
A. Cable B. DSL C. Fiber D. ISDN
Which of the following is a serif font?
A. Arial B. Helvetica C. Georgia D. All of the above