From a780fa3c167259abf9c82348701e08d19b8204dc Mon Sep 17 00:00:00 2001 From: Fuyuxinge <1876397977@qq.com> Date: Fri, 19 Jun 2026 12:15:53 +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'w6'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- w6/Cat.java | 9 +++++++++ w6/Dog.java | 13 +++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 w6/Cat.java create mode 100644 w6/Dog.java diff --git a/w6/Cat.java b/w6/Cat.java new file mode 100644 index 0000000..014fabf --- /dev/null +++ b/w6/Cat.java @@ -0,0 +1,9 @@ +package w6; + +public class Cat extends Animal { + @Override + public void makeSound() { + System.out.println("喵喵喵"); + } + +} diff --git a/w6/Dog.java b/w6/Dog.java new file mode 100644 index 0000000..82c73cd --- /dev/null +++ b/w6/Dog.java @@ -0,0 +1,13 @@ +package w6; + +public class Dog extends Animal implements Swimmable{ + @Override + public void makeSound() { + System.out.println("汪汪汪!"); + + } + @Override + public void swim() { + System.out.println("狗刨式游泳"); + } +} \ No newline at end of file