Thread Sample - II

package threads;

/**
*
* @author Nurhak
*/
public class Threads {

/**
* @param args the command line arguments
*/
public static void main(String[] args) {

Worker w1=new Worker();
Worker w2=new Worker();

w1.start();
w2.start();
}
}


package threads;

/**
 *
 * @author Nurhak
 */
public class Worker extends Thread {

    @Override
    public void run() {
        for (int i = 0; i < 10; i++) {

            System.out.println(this.getName() + "-->" + i);

        }
    }
}

Comments

Popular posts from this blog

Solution for "Can not obtain Oracle client information from registry"

Solution for the fault: "System.Diagnostics.Process.Start is not working on IIS, but working on ASP.NET Development Server"

Getting Umbraco Content - IPublishedContent vs IContent vs Node vs Document