Description: Inherit
1. Purpose of the experiment
Consolidation of the following concepts:
Subclass inheritance, sub-class object creation, inheritance and hiding member variables, methods, inheritance and override.
2. Experimental requirements
(1) Write a Java application, in addition to the main class of things, the program also defined four categories: People, ChinaPeople, AmericanPeople and BeijingPeople class, requirements are as follows:
People have access to a protected class of double-type members: height and weight, as well as public void speakHello (), public void averageHeight () and public void averageWeight () method.
ChinaPeople People class is a subclass of added public void chinaGongfu () method. As requested by the parent class public void speakHello (), public void averageHeight () and public void averageWeight () method.
AmericanPeople People class is a subclass of added public void americanBoxing () method. As requested by the parent cl
To Search:
- [java] - University java all practical tutorial f
File list (Check if you may need any files):
Example.doc
Example.class
Example.java