ITPub博客

首页 > IT职业 > IT图书 > 面向对象作业1——电话,短信

面向对象作业1——电话,短信

IT图书 作者:kikiboy 时间:2021-09-09 08:57:48 0 删除 编辑

public class Message{
private String message;
private Integer[] phoneNumber;
boolean isSend;
}

public class Telephone {
//属性
public Integer[] phoneNumber;
public HashMap phoneBook;
public class phoneInfo{
private float screen;
private float cpu;
private float mem;
}

//方法

public void call(Integer[] phoneNumber){
    System.out.println("通过电话号码打电话");
    //call the phone number
}

public void call(String phoneName){
    System.out.println("通过联系人姓名打电话");
    this.call(this.phoneBook.get(phoneName));
}

public Integer[] answer(){      //接电话
    Integer[] phone = null;
    return phone;
}

public void sendMessage(Message aMessage){
    System.out.println("通过键盘发短信");
    //send message
}

public Message receiveMessage(){        //接受短信
    Message message = null;
    return message;
}

}

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/4588/viewspace-2798223/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2019-08-13

  • 博文量
    0
  • 访问量
    465