面向对象具体实例Pet
package oop.demo03;
public class Pet {
public String name;
public int age;
public void shout(){
System.out.println("叫了一声");
}
}
/*
public static void main(String[] args) {
Pet dog = new Pet();
dog.age= 3;
dog.name="77";
dog.shout();
System.out.println(dog.name);
System.out.println(dog.age);
}
*/
面向对象具体实例Pet最先出现在Python成神之路。
共有 0 条评论