手记

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

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

public class Telephone {
//属性
public Integer[] phoneNumber;
public HashMap<String,Integer[]> 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;
}

}

0人推荐
随时随地看视频
慕课网APP