OOPS CIA III QUESTION BANK
Part A
1. Define Exception.
2. Differentiate between error and exception.
3. Draw the exception hierarchy.
4. What is the use of finally block?
5. List any five Runtime and five built in exception classes.
6. Mention the importance of Date and Time API introduced in Java 1.8.
7. Compare throw and throws in exception.
8. What is thread priority?
9. Give the difference between multitasking & multithreading.
10. Draw the neat sketch of Thread Life Cycle.
11. What is the need of Java Synchronization Blocks?
12. List the similarities and dissimilarities between list and set interfaces in java.
13. Define Thread Pool.
PART B
1. Explain how exception is handled in java. Write a Java program to handle divide by zero
exception.
2. Get the input String from user and parse it to integer, if it is not a number it will throw
number format exception Catch it and print "Entered input is not a valid format for an
integer." or else print the square of that number.
Input 1:
Enter an integer:
12
Output 1:
The square value is 144
The work has been done successfully
Input 2:
Enter an integer:
Java
Output 2:
Entered input is not a valid format for an integer
3. Write a Java program with multiple catch blocks.
4. Write a calculator program using exceptions and functions.
5. (a) How will you create your Own Exception Subclasses?
(b) Write a java program to create a custom exception. Mr. Jack is very fond of
programming in Java. Therefore, he hates C++.Write a program to throw an exception if the
word (string) C++ is entered.
6. Explain the necessity of drivers and describe the steps involved in establishment of a
JDBC connection to retrieve the data from database.
7. (i)Write a short note on Java Executor Frameworks.
(ii)Explain the 2 ways to create threads in Java with example.
8. Write a Java Program that inserts book details like bookid, author, pages, price, in to
library database, update the database by adding publisher column and display the result
from library database using JDBC connectivity.
9. Create a class TestArrayList with main method in it and Perform the following
operations.
Create an ArrayList to store name of the product
Store different product names. Try to add duplicate product names.
Print all product names
Print first and last product name alone
Print the size of ArrayList
Remove a particular product from ArrayList
10. List the any 5 methods of Map Interface and explain each method with example.