rendered paste bodypublic class TestClass { static class FirstThread extends Thread { public void run( ) { for ( int loopCount = 0; loopCount < 10; loopCount++ ) { System.out.println( "firstThread" ); try { this.sleep( 100 ); } catch (InterruptedException e) { } } } } static class SecondThread extends Thread { public void run( ) { for ( int loopCount = 0; loopCount < 10; loopCount++ ) { System.out.println( "secondThread" ); try { this.sleep( 100 ); } catch (InterruptedException e) { } } } } public static void main( String[] args ) { Thread firstThread = new TestClass.FirstThread( ), secondThread = new TestClass.SecondThread( ); firstThread.start( ); secondThread.start( ); }}