package dog;
import java.util.*;
public class Dog {
private String dogName;
private String dogColor;
private int age;
Scanner sc=new Scanner(System.in);
Dog(){
System.out.println("请输入狗的名字:");
dogName=sc.next();
System.out.println("请输入狗的颜色:");
dogColor=sc.next();
System.out.println("请输入狗的年龄:");
age=sc.nextInt();
}
void display() {
System.out.print("狗的名字:"+dogName+' '+"狗的颜色:"+dogColor+' '+
"狗的年龄:"+age+'
');
}
public static void main(String[] args) {
// TODO 自动生成的方法存根
Dog d=new Dog();
d.display();
}
}