A) Explain the difference between runtime errors and compile time errors with example. Q.3 (B) Difference between static and instance variable with example. Q.4(A) 1. To display “Hello India” on frame. 2. To display weekdays along with its description using enum data type. Weekdays Description Sunday Sun Monday Moon Tuesday Mars Wednesday Mercury Thursday Jupiter Friday Venus Saturday Saturn Q.4 (B) Write program for following. 1. To display contents of text file on console if file exist. Provide file name from command-line argument. 2. To find average of values given as a command-line arguments. Also write necessary exception handling code
[3 marks]Q.4(A) What is difference between Vector and Hashtable class? How the Enumeration interface is useful in Java explain with code? Q.4 (B) 1. What is container and component class in Java? Specify different types of components with its events? 2. Explain final, native and synchronized method modifier.
[3 marks]A) What is CLASSPATH? How it is important? Q.5 (B) Define Thread. How different way thread is created in Java? Discuss the Thread life cycle with suitable example of java program code.
[7 marks]Q.5(A) Write program for following. 1. To copy file using character stream. Provide source file name and destination file name using command-line arguments. 2. To create two different threads. One thread to display odd numbers between 1 to 40 at every 1 second and other thread to display even numbers between 1 to 20 at every 2 seconds. Q.5 (B) Explain final, native and synchronized method modifier.