Joke Collection Website - Public benefit messages - Java short message interface tutorial
Java short message interface tutorial
Import java.util.scanner;
Public class entry {
Public static void main (strinargs []) {
Scanner sc = new scanner (system. in);
String pno, msg
System.out.print ("Please enter message content:");
msg = sc . nextline();
System.out.println ("Please enter the target mobile phone number:");
pno = sc . nextline();
short mesg newmsg = new short mesg();
newmsg . set phoneno(pno);
newmsg . set message(msg);
SendMesg send = new SendMesg(newmsg);
send . send();
}
}
Class is called g {
Public abbreviation g(){
}
Private string pno, msg
Public empty phone number (string pno ){ (
this.pno = pno
}
Public string getPhoneNO(){
Return this.pno
}
Public void setMessage (
this.msg = msg
}
Public string getMessage(){
Return this.msg
}
}
Class sends messages {
Private short message MMS;
Public sending MMS (short message MMS) {
this.mms = mms
}
Public void send(){
System.out.println ("SMS content:"+MMS. getmessage ());
System.out.println ("target phone:"+mms.getphoneno ()+"\ n");
}
}
- Related articles
- Qingcheng sent He Daojun to challenge Tai Sen in the afternoon. Why did Tai Sen dare not accept the challenge? What's he worried about?
- Qingdao Middle School Opening Time 2022
- How can a mobile phone distinguish between true and false?
- What value can the implementation of electronic bidding bring to enterprises?
- The Postal Savings Bank opened the SMS service. Why did it only receive the verification code of the mobile phone after paying the money, and did not send the information display card?
- Why can't Apple 4 send text messages?
- Introduce France in English
- What if the bank card is frozen by the police?
- What are the rights and interests of Gansu Bank Longjing Credit Card?
- How to set up siri to help me fight the peace elite?