Joke Collection Website - Public benefit messages - JAVA defines a telephone class. Define methods to realize the functions of calling, sending short messages and sending multimedia messages respectively, and ask powerful JAVA experts for help.

JAVA defines a telephone class. Define methods to realize the functions of calling, sending short messages and sending multimedia messages respectively, and ask powerful JAVA experts for help.

Public telephone extension thread (

private int telNum

Private int type; //0 SMS, 1 MMS, 3 phone calls

Private string message;

Int telNum (int type, string message) (

this.telNum = telNum

this.type = type

this.message = message

}

//Send SMS

Private void sendMessage(int telNum, string message) (

}

//Send MMS

private void sendColor(int telNum,String message){

}

//Call

Private synchronous invalid call (int telnum) (

}

//Turn off the phone

Private void closeTel(){

}

Public invalid operation () {

if(type==0){

sendMessage(this.telNum,this . message);

}

if(type== 1){

sendColor(this.telNum,this . message);

}

if(type==2){

call(int telNum);

} else { closeTel(); }

}

}