java asynchronous code execution

public class SmsSendAsync{

private final GlobalInput cGlobalInput;

private String prtNo;

public SmsSendAsync(String prtNo) {

  this.prtNo = prtNo;

}

public void send() {

  //Newly defined thread to handle sending

new Thread(){

   public void run(){

      //You can write a wait method here to make the current thread wait for 10 seconds.

     // console print log

      System.out.println(Content);

    }

}.start();

}

 

public static void main(String[] args) {

String prtNo = "1001200912310155555";

// call to send SMS asynchronously

SmsSendAsync  sendAsync =  new  SmsSendAsync (prtNo);

sendAsync.send();

System .out .println ("Signed") ;

 

}

 

}

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325036452&siteId=291194637