java2021/3.21
public class Demo01phoneOne{
public static void main(String[] args){
phone one =new phone();
System.out.println(one.brand);
System.out.println(one.price);
System.out.println(one.color);
one.brand=“苹果”;
one.brand=“8388.0”
one.brand=“黑色”
System.out.println(one.brand);
System.out.println(one.price);
System.out.println(one.color);
one.call(“乔布斯”);
one.sendMessage();
public class phone{
Sting brand;
double price;
String color;
public void call(String who){
System.out.println(“给”+who+“打电话”)
}
public void Message(){
System.outprintln(“群发短信”);
}
}
stubdent stu= new Stuent();
System.outprintln(stu.name);
System.outprintln(stu.age);
stu.name =“xxx”;
stu.age=18;
System.outprintln(stu.name);
System.outprintln(stu.age);
stu.eat();
stu.sleep();
stu.study();
}
}