public class mobile1 {
//品牌
public String brand;
//类型
public String generation;
//价格
public int price;
//发短信函数
public void sendmassage(String name){
System.out.println(name+"晚上有空吗?");
System.out.println("---此短信通过"+this.brand+"手机发送");
}
public mobile1(){
}
public mobile1(String brand,String generation,int price){
this.brand=brand;
this.generation = generation;
this.price =price;
}
public static void main(String [] args){
mobile1 mobile2 = new mobile1("huawei","mate",88);
String name = "xiaoming";
mobile2.sendmassage(name);
}
}