Created
March 3, 2010 19:29
-
-
Save tmountain/320915 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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