Page 157 - CTS - CSA TP - Volume 2
P. 157

COMPUTER SOFTWARE APPLICATION - CITS




              •  A new class named ThreadExtends is defined (this class contains the main method).
              •  Inside the main method:
              •  An instance of ThreadExtends is created and assigned to the variable t1.
              •  The start  method is called on t1.  This initiates the execution of the thread, and the run method of
                 ThreadExtends will be executed in a separate thread.
           Step 3: Execution
           When you run this program, it will output messages similar to the following:











































































                                                           142
                                CITS : IT & ITES - Computer Software Application - Exercise 102
   152   153   154   155   156   157   158   159   160   161   162