Thread Basics 1- Thread Creation : There are two ways of creating a new thread. Way-1 Implementing Runnable Interface: public class CustRunnable implements Runnable { public void run () { System . out . println ( "Executed !" ); } public static void main ( String args []) { Thread myThread = new Thread ( new CustRunnable ()); myThread . start () } } Way-2 Extending Thread Interface: public class CustThread extends Thread { public void run () { System . out . println ( "Executed from a new thread!" ); } public static void main ( String args []) { ...
Software Engineering experiences and best practices