diff --git a/src/main/java/com/zeekling/exten/ExtendsTest.java b/src/main/java/com/zeekling/exten/ExtendsTest.java new file mode 100644 index 0000000..ef69307 --- /dev/null +++ b/src/main/java/com/zeekling/exten/ExtendsTest.java @@ -0,0 +1,36 @@ +package com.zeekling.exten; + +/** + * @author zeekling + * @apiNote https://www.nowcoder.com/question/next?pid=30695833&qid=15977&tid=44372102 + * @since 2021-05-16 + */ +public class ExtendsTest { + + public static void main(String[] args) { + Base base = new Son(); + base.method(); + //base.methodB(); + } + +} + +class Base +{ + public void method() + { + System.out.println("Base"); + } +} +class Son extends Base +{ + public void method() + { + System.out.println("Son"); + } + + public void methodB() + { + System.out.println("SonB"); + } +} diff --git a/src/main/java/com/zeekling/thread/ThreadTest.java b/src/main/java/com/zeekling/thread/ThreadTest.java new file mode 100644 index 0000000..54786dc --- /dev/null +++ b/src/main/java/com/zeekling/thread/ThreadTest.java @@ -0,0 +1,25 @@ +package com.zeekling.thread; + +/** + * @author zeekling + * @apiNote https://www.nowcoder.com/question/next?pid=30695833&qid=4339&tid=44372102 + * @since 2021-05-16 + */ +public class ThreadTest { + + public static void main(String args[]) { + Thread t = new Thread() { + public void run() { + dianping(); + + } + }; + t.run(); + System.out.print("dazhong"); + } + + static void dianping() { + System.out.print("dianping"); + } + +}