tailieunhanh - Java™ How to Program ( Deitel - Deitel) - Phần 16

Tham khảo sách 'java™ how to program ( deitel - deitel) - phần 16', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | PREV NEXT Page 415 Chapter 9. Object-Oriented Programming Inheritance Say not you know another entirely till you have divided an inheritance with him. Johann Kasper Lavater This method is to define as the number of a class the class of all classes similar to the given class. Bertrand Russell Good as it is to inherit a library it is better to collect one. Augustine Birrell Save base authority from others books. William Shakespeare OBJECTIVES In this chapter you will learn How inheritance promotes software reusability. The notions of superclasses and subclasses. To use keyword extends to create a class that inherits attributes and behaviors from another class. To use access modifier protected to give subclass methods access to superclass members. To access superclass members with super. How constructors are used in inheritance hierarchies. The methods of class Object the direct or indirect superclass of all classes in Java. Page 416 Outline Introduction Superclasses and Subclasses prot ected Members Relationship between Superclasses and Subclasses Creating and Using a CommissionEmployee Class Creating a BasePlusCommissionEmployee Class without Using Inheritance Creating a CommissionEmployeeBasePlusCommissionEmployee Inheritance Hierarchy CommissionEmployeeBasePlusCommissionEmployee Inheritance Hierarchy Using protected Instance Variables CommissionEmployeeBasePlusCommissionEmployee Inheritance Hierarchy Using private Instance Variables Constructors in Subclasses Software Engineering with Inheritance Object Class Optional GUI and Graphics Case Study Displaying Text and Images Using Labels Wrap-Up Summary Terminology Self-Review Exercises Answers to Self-Review Exercises Exercises PREV NEXT PREV NEXT Page 416 continued . Introduction This chapter continues our discussion of object-oriented programming OOP by introducing one of its primary featuresinheritance which is a form of software reuse in which

TỪ KHÓA LIÊN QUAN