1. Replication (override)
1) exists with the parent class and subclass;
2) Each of the parent and child classes has a function, the two function names, the return value type, the parameter list, exactly the same, which is called the relationship between the two functions as a replication (override);
// Parent Class class father{ void function () { System.out.println ("Function of the parent class");} }
// sub-class class extends father{ void function () { System.out.println ("function of the subclass");} }
This means that there is a replication relationship between the function functions in Son and father.
2. Call the member function in the parent class with super;
1) use Super.function () to invoke functions in the parent class, such as:
// Parent Class class father{ void function () { System.out.println ("Function of the parent class");} }
// sub-class class extends father{ void function () {
super.function (); System.out.println ("function of the subclass");} }
Java4android Basic Learning Replication (override)