1
2
3
4
5
6
7
8
9
10
11
12
13
public Employee (){number =0;name=“”;}
Note:Add a default constructor
Note:The default constructor is called as the first statement in the subclass constructor
14
15
16
17
18
19
20
Include this part in the
subclass constructor
21
22
23
24
25
in branNA: String
in bankNA: String
26
Note: super can be used to access the supers class methods and attributes. For example:super.getName();super.accNumber;
27
Top Related