摘要:
public class Dog {// 定义属性 String nick; String color; int age; // 定义构造方法 public Dog(String nick,String color,int age){// 构造方法的作用是为对象的属性赋值 this.nick=nic 阅读全文
posted @ 2021-12-30 15:44
小小生Sir
阅读(20)
评论(0)
推荐(0)
摘要:
// 定义属性 String nick; String color; int age;// 定义类的方法 public void eat(){ System.out.println("在吃东西"); } public void run(){ System.out.println("在跑步"); } 阅读全文
posted @ 2021-12-30 15:07
小小生Sir
阅读(33)
评论(0)
推荐(0)

浙公网安备 33010602011771号