Java UT2 Question Bank
Java UT2 Question Bank
1. Explain exception handling mechanism. w.r.t. try, catch, throw and finally.
2. Write the syntax of try-catch-finally blocks.
3. Define error. List types of error.
4. Draw and explain life cycle of Thread.
5. Define exception. State built-in exceptions.
6. Write a program to input name and salary of employee and throw user defined exception
if entered salary is negative.
7. Write a program to create two threads one thread will print even no. between 1 to 50 and
other will print odd number between 1 to 50.Define thread priority? Write default priority
values.
Ch No 5
1. Write a java applet to display the following output in Red color. Refer Fig No. 1. (4 m)
Fig No. 1.
Ch No 6
1. Define stream class. List its types.(2 M)
2. Explain any two methods of File Class.(2M)
3. List the methods of File Input Stream Class.(2M)
4. Write a Java program to count the number of words from a text file
using stream classes.(4M)