File tree Expand file tree Collapse file tree 2 files changed +41
-0
lines changed
src/main/java/com/zz/java/overridetest Expand file tree Collapse file tree 2 files changed +41
-0
lines changed Original file line number Diff line number Diff line change
1
+ package com .zz .java .overridetest ;
2
+
3
+ /**
4
+ * @Author: zengzhen
5
+ * @Date: 2019/7/8 11:06
6
+ * @Version 1.0
7
+ */
8
+ public class FatherClass extends SunClass {
9
+ @ Override
10
+ public final void sing () {
11
+ System .out .println ("father - sing" );
12
+ super .sing ();
13
+ }
14
+ @ Override
15
+ public final void dance () {
16
+ System .out .println ("father - dance" );
17
+ }
18
+
19
+ public static void main (String [] args ) {
20
+ FatherClass fatherClass =new FatherClass ();
21
+ fatherClass .sing ();
22
+ }
23
+ }
Original file line number Diff line number Diff line change
1
+ package com .zz .java .overridetest ;
2
+
3
+ /**
4
+ * @Author: zengzhen
5
+ * @Date: 2019/7/8 11:05
6
+ * @Version 1.0
7
+ */
8
+ public class SunClass {
9
+ public void sing ()
10
+ {
11
+ System .out .println ("sun - sing" );
12
+ dance ();
13
+ }
14
+ public void dance ()
15
+ {
16
+ System .out .println ("sun - dance" );
17
+ }
18
+ }
You can’t perform that action at this time.
0 commit comments