主类怎么加进去啊,代码错了不会改
public class dog { int age =5; String name="乐乐"; String color="白色"; int weight =10; String sex="female"; void eat() { } void look() { } void yao() { } void run() { } void swim() { } {System.out.println("beef"); System.out.println("person"); System.out.println("旺旺~~~~~"); System.out.println("quick"); System.out.println("会"); } public class dog1 extends dog {public dog1(){ super(); } public class dog2 extends dog {public dog2(){ this(); } }
public static void main (String args[]) { dog dog=new dog(); System.out.println("姓名:"+dog.name); System.out.println("年龄:"+dog.age); System.out.println("颜色:"+dog.color); System.out.println("体重:"+dog.weight); System.out.println("性别:"+dog.sex); dog.eat(); dog.look(); dog.yao(); dog.run(); dog.swim();}