Hi everyone!
I tried to make a Thread, but it doesn't work.
I have a class called NetMyThread, which implements Runnable.
Has a: private Thread myThread; as a variable, which is initialized in the init as follows:
the run function looks like this:
I can't see anything written out on the console. What's wrong with my code?
Thanks!
Aeren
I tried to make a Thread, but it doesn't work.
I have a class called NetMyThread, which implements Runnable.
Has a: private Thread myThread; as a variable, which is initialized in the init as follows:
Code:
myThread = new Thread( this ); (init is called from the constructor)
myThread.start( );
the run function looks like this:
Code:
public void run( ) {
try {
for (int i=0;i<5;i++){
Thread.sleep( time );
System.out.println("blahblah");
differenceEngine( );
}
} catch( InterruptedException e ) { System.out.println( e.toString( ) ); }
}
Thanks!
Aeren