Skip to content

Instantly share code, notes, and snippets.

@sniper7kills
Last active May 9, 2016 23:11
Show Gist options
  • Save sniper7kills/fcc90d89cbf7803ffd1edc412be7ad63 to your computer and use it in GitHub Desktop.
Save sniper7kills/fcc90d89cbf7803ffd1edc412be7ad63 to your computer and use it in GitHub Desktop.
/* ThreadEx1.java:A simple program creating and invoking a thread object by extending the standard Thread class. */
class MyThread extends Thread {
public void run() {
System.out.println(“ this thread is running ... ”);
}
}
class MAINPROGRAM {
public static void main(String [] args ) {
MyThread t = new MyThread();
t.start();
MyThread t2 = new MyThread();
t2.start();
t.stop();
t2.stop();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment