==
package Demo3; /** * Title:- Advanced Java_ Multi-threading Part 2 -- Basic Thread Synchronization - 2 * @author Dharmaraj.Net * This example shows how implements Runnable interface execute your thread */ public class App { public static void main(String[] args) { Thread t1 = new Thread(new Runnable(){ public void run() { for (int i = 0; i < 10; i++) { System.out.println("Hello" + "=" + i); try { Thread.sleep(100); } catch (InterruptedException e) { e.printStackTrace(); } } } }); t1.start(); } }
No comments:
Post a Comment