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

COMPUTER SOFTWARE APPLICATION - CITS



           When you run this program, it will output:












           Related Exercises:
           1  Write a program that prints “Good morning” and “Welcome” continuously on the screen in Java using threads.

           2  Add a step method in the welcome thread of question 1 to delay its execution for 200ms.
           3  Demonstrate gerPriority() and setPriority() methods in Java threads.
           4  How do you get the state of a given thread in Java?
           5  How do you get the reference to the current thread in Java?
           6  Write a program that performs a file transfer using multiple threads.
           7  Write a program that performs a database operation using multiple threads.

           8  Write a program that handles the following exceptions:
              •  FileNotFoundException
              •  IOException
              •  NullPointerException

              •  ArithmeticException
           9  Write a program that uses the finally block to ensure that resources are always closed, even if an exception
              occurs.












































                                                           160

                              CITS : IT & ITES - Computer Software Application - Exercise 108
   170   171   172   173   174   175   176   177   178   179   180