From e70289921ea4a69492debda319d6558473d28e16 Mon Sep 17 00:00:00 2001 From: peisishuang <1767255628@qq.com> Date: Mon, 13 Apr 2026 14:32:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6=E8=87=B3?= =?UTF-8?q?=20''?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- W6-动物叫声系统.txt | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 W6-动物叫声系统.txt diff --git a/W6-动物叫声系统.txt b/W6-动物叫声系统.txt new file mode 100644 index 0000000..0055a97 --- /dev/null +++ b/W6-动物叫声系统.txt @@ -0,0 +1,22 @@ +public abstract class AinmalSound { + public abstract void makeSound(); +} +interface Swimmable{ + void swim(); +} +class Cat extends AnimalSound { + @Override + public void makeSound() { + System.out.println("猫:喵喵喵!"); + } +} +class Dog extends AnimalSound implements Swimmable { + @Override + public void makeSound() { + System.out.println("狗:汪汪汪!"); + } + @Override + public void swim() { + System.out.println("狗:我会游泳!"); + } +} \ No newline at end of file