- 狗的一个类,包括 名字,颜色,年龄;典型的java类的一段代码
class Dog {
private String name;
private String color;
private int age;
public Dog(){}
public Dog(String name,String color,int age){
this.name = name;
this.color = color;
this.age = age;
}
public String getInfo(){
return "
标签:String,案例,color,age,Dog,面向对象,5.21,public,name
From: https://www.cnblogs.com/pansidong/p/17453052.html