正在加载

商标名字测试打分靠谱

  • 作者: 帝神小编
  • 来源: 帝神算命网
  • 2022-09-28
比较简单的一个实现方法:

public class Phone {

private String phone_type;
private String phone_kind;
private String phone_message;

public Phone(String type, String kind, String message){

this.phone_type = type;
this.phone_kind = kind;
this.phone_message = message;
}

public static void main(String[] args){

Phone p = new Phone("Nokia" ,"N75" , "You have a text message");
System.out.println("phone_type: " + p.phone_type + "\n"
+ "phone_kind: " + p.phone_kind + "\n"
+ "phone_message:" + p.phone_message);
}
}



  public class Mobile{
private String bundle;
private String model;
public String getBundle() {
return bundle;
}
public void setBundle(String bundle) {
this.bundle = bundle;
}
public String getModel() {
return model;
}
public void setModel(String model) {
this.model = model;
}

public Mobile(){
super();
}
public Mobile(String bundle, String model) {
super();
this.bundle = bundle;
this.model = model;
}

public void showInfo(){
System.out.println("品牌:"+bundle+"\n型号:"+model);
}
}

==================测试类====================

public class TestMobile {
public static void main(String args[]){
Mobile mobile=new Mobile("Nokia","N97");
mobile.showInfo();
}
}



  手机类直接用javabean,信息显示直接打印一下,测试类就写点断言式,分给了晚上给你发过去。



  我觉得应该是属于的啊


『帝神算★命网』文章,未经允许不得转载!

展开全文