Inheritance in java is a mechanism in which one object acquires all the properties and behaviors of parent object. Inheritance allows us to order class in hierarchy and multiple layers of functionality.

uses relationship (dependency), and this is represented by the doted line on the blueJ interface.

inheritance (is a relationship). We need to write “extend” on the arrow in exam to show this kind of relationship.

implicit inovation: it is the default method to call the first constructor from the super class. There is no need to write argument list in the call.

explicit invocation constructor: super (argument list);

overriden public or protected method: super.methodName(argument list)
A newer version of the program is provided, while the older version is still accessible.
The first question instructs us to establish the inheritance relationship. We use “extends.”
Screen Shot 2017-06-15 at 19.24.13.png
Question two: basic declaration of field.
Screen Shot 2017-06-15 at 19.51.26.png
Question three: Here the notion of explicit innovation is used.
 Screen Shot 2017-06-15 at 19.57.27.png

Question four: A new set of parameters override the default values in the field. The super(startBalance) calls the overloaded constructor, and then setInterestRate will pass the startInterestRate.
Screen Shot 2017-06-15 at 20.01.56.png
Question five: apply the monthly interest rate. It should be noted that it is the monthly interest we want, rather than the yearly. Screen Shot 2017-06-15 at 20.05.38.png
This toString method is an instance of overridden method mentioned above. It provides a new version of the program which has more functions, in this case, it is formatted differently.
Screen Shot 2017-06-15 at 20.20.38.png