标签:class http src ima 图片 new name system pac
package java_class_homework;
public class Cat {
String name;
String type;
String master;
int age;
// age
public void setAge(int age) {
this.age=age;
}
public int getage() {
return age;
}
// name
public void setName(String name) {
this.name=name;
}
public String getName() {
return name;
}
// type
public void setType(String type) {
this.type=type;
}
public String getType() {
return type;
}
// master
public void setMaster(String master) {
this.master=master;
}
public String getMaster() {
return master;
}
}
package java_class_homework;
public class Class_text {
public static void main(String[] args) {
// TODO Auto-generated method stub
Cat cat = new Cat();
cat.name="小咪";
cat.age=2;
cat.type="苏格兰折耳猫";
cat.master="李华";
System.out.println("name:"+cat.name+"\nage:"+cat.age+"\ntype:"+cat.type+"\nmaster:"+cat.master);
}
}
name:小咪
age:2
type:苏格兰折耳猫
master:李华
标签:class http src ima 图片 new name system pac
原文地址:https://www.cnblogs.com/Emcikem/p/11432281.html