Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class ClientThread implements Runnable {
- private Thread t;
- private String threadName = "Client threa";
- RunnableDemo(){};
- public void run() {
- // What to do
- }
- public void start () {
- System.out.println("Starting " + threadName );
- if (t == null) {
- t = new Thread (this, threadName);
- t.start ();
- }
- }
- }
- public static void main(String args[]) {
- ClientThread Thread1 = new ClientThread();
- Thread1.start();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement