Skip to content

Commit 1f416f7

Browse files
committed
feat: 接口和抽象类
1 parent 51e6cef commit 1f416f7

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.wdbyte.oop.abs;
2+
3+
/**
4+
* @author https://www.wdbyte.com
5+
*/
6+
public abstract class AbsPerson2 {
7+
8+
public void sayHello() {
9+
System.out.println("say hello");
10+
}
11+
12+
public abstract void sleep();
13+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package com.wdbyte.oop.interfac;
2+
3+
public interface InterfacePerson {
4+
default void sayHello(){
5+
System.out.println("say hello");
6+
}
7+
8+
void sleep();
9+
}

0 commit comments

Comments
 (0)