FileDocCategorySizeDatePackage
ShowStates.javaAPI DocExample587Sat Apr 23 22:35:26 BST 2005None

ShowStates

public class ShowStates extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)

		new Thread() {
			public void run() {
				try {
				new ServerSocket(1234).accept();
				} catch ( IOException e ) { }
			}
		}.start();
		Thread.sleep(2000);

		while( true ) 
		{
		Thread [] threads = new Thread [ 10 ]; // max threads
		int num = Thread.enumerate( threads );
		for( int i = 0; i < num; i++ )
		{
			System.out.println( threads[i] );
			System.out.println( threads[i].getState() );
		}
		Thread.sleep(1000);
		}