Search This Blog

question and assignment on exception handling

assignment is for core java newbie,beginners,advanced,programmers and coders
exception handling questions and assignments with solution solved and some unsolved

here is

Core Java Assignment - II

1. Write a program to demonstrate the use of try, catch, finally throw and throws keywords and demonstrate the following points in the program.

a) Multiple catch blocks.
b) try-catch-finally combination.
c) try-finally combination.
d) Exception propagation among many methods.
e) Use of getMessage(), printStackTrace() function of Throwable class.
f) Nested try blocks

2. Write a program to throw a checked exception explicitly using 'throw' keyword and

a) Handle the exception in same method.
b) use throws clause and handle the exception in some other method (calling method)
c) Don't either handle or use the throws clause.

3. Repeat program 2 with unchecked Exception and demonstrate the difference in both program.

4. Create a user defined exception to check whether your employee exist in your data structure (use any data structure to store the employees - like array, ArrayList etc) and throw exception if name is not in the employees list. Use the catch and finally block to make an appropriat

2 comments: