Đang chuẩn bị liên kết để tải về tài liệu:
Introduction to java programming: Chapter 9 - Inheritance and Polymorphism

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

Introduction to java programming: Chapter 9 - Inheritance and Polymorphism's Objectives is to develop a subclass from a superclass through inheritance; invoke the superclass’s constructors and methods using the super keyword; override methods in the subclass; distinguish differences between overriding and overloading. | Chapter 9 Inheritance and Polymorphism Liang Introduction to Java Programming Sixth Edition c 2005 Pearson Education Inc. All rights reserved. 0-13-148952-6 1 Objectives To develop a subclass from a superclass through inheritance 9.2 . To invoke the superclass s constructors and methods using the super keyword 9.3 . To override methods in the subclass 9.4 . To distinguish differences between overriding and overloading 9.5 . To explore the useful methods equals Object hashCode toString fìnalize clone and getClass in the Object class 9.6 9.13 optional . To comprehend polymorphism dynamic binding and generic programming 9.7 . To describe casting and explain why explicit downcasting is necessary 9.8 . To store retrieve and manipulates objects in an ArrayList 9.9 . To implement a Stack class using ArrayList 9.10 . To restrict access to data and methods using the protected visibility modifier 9.11 . To declare constants unmodifiable methods and nonextendable classes using the final modifier 9.12 . Optional To understand the effect of hiding data fields and static methods 9.14 . Optional To initialize data using initialization blocks and to distinguish between instance initialization and static initialization blocks 9.15 . Optional GUI To use inheritance in GUI programming 9.16 . Liang Introduction to Java Programming Sixth Edition c 2005 Pearson Education Inc. All 2 rights reserved. 0-13-148952-6 2 Superclasses and Subclasses GeometricObject -color String -filled boolean -dateCreated java.util.Date The color of the object default white . Indicates whether the object is filled with a color default false . The date when the object was created. GeometricObj ect getColor String setColor color String void isFilled boolean setFilled filled boolean void getDateCreated java.util.Date toString String Creates a GeometricObject. Returns the color. Sets a new color. Returns the filled property. Sets a new filled property. Returns the dateCreated. Returns a string representation of .