Creating a thread:
Declare a class as a sub class of Thread
Class SampleThread extends Thread
{
Long minSample; {
SampleThread( Long minSample);
}
Public void run()
{
Program goes here
}
}
Run the thread: An instance is created to start the thread.
SampleThread s = new SampleThread(100);
s.start();