Skip to content

Instantly share code, notes, and snippets.

@tmountain
Created March 3, 2010 19:29
Show Gist options
  • Save tmountain/320915 to your computer and use it in GitHub Desktop.
Save tmountain/320915 to your computer and use it in GitHub Desktop.
public class T {
private static class ThreadWithArg extends Thread {
private int x;
public ThreadWithArg(int x) {
this.x = x;
}
public void run() {
System.out.println("x = " + String.valueOf(this.x));
}
}
public static void main(String[] args) {
ThreadWithArg t = new ThreadWithArg(5);
t.start();
try {
Thread.sleep(1000);
} catch (InterruptedException e) { }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment