Advertisement
Guest User

Untitled

a guest
Dec 11th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.51 KB | None | 0 0
  1. class ClientThread implements Runnable {
  2.    private Thread t;
  3.    private String threadName = "Client threa";
  4.    
  5.    RunnableDemo(){};
  6.    
  7.    public void run() {
  8.      // What to do
  9.    }
  10.    
  11.    public void start () {
  12.       System.out.println("Starting " +  threadName );
  13.       if (t == null) {
  14.          t = new Thread (this, threadName);
  15.          t.start ();
  16.       }
  17.    }
  18. }
  19.  
  20.  
  21.  
  22.    public static void main(String args[]) {
  23.       ClientThread Thread1 = new ClientThread();
  24.       Thread1.start();
  25.    }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement