0% found this document useful (0 votes)
67 views

Java 3 QB

This document contains a sample exam paper for the subject Java Programming from Vivekanandha College of Engineering for Women. The paper contains 20 questions in Part A worth 2 marks each and 10 questions in Part B with questions worth between 5-15 marks. The questions cover various topics related to exception handling in Java like the definition of exceptions, exception hierarchy, checked and unchecked exceptions, exception handling mechanism, rethrowing exceptions, built-in exceptions and creating custom exceptions.

Uploaded by

CSE VCEW
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
67 views

Java 3 QB

This document contains a sample exam paper for the subject Java Programming from Vivekanandha College of Engineering for Women. The paper contains 20 questions in Part A worth 2 marks each and 10 questions in Part B with questions worth between 5-15 marks. The questions cover various topics related to exception handling in Java like the definition of exceptions, exception hierarchy, checked and unchecked exceptions, exception handling mechanism, rethrowing exceptions, built-in exceptions and creating custom exceptions.

Uploaded by

CSE VCEW
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

VIVEKANANDHA COLLEGE OF ENGINEERING FOR

WOMEN
(AUTONOMOUS INSTITUTION AFFILIATED TO ANNA UNIVERSITY, CHENNAI)

OFFICE OF THE CONTROLL.ER OF EXAMINATIONS

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


Dept / Year / Sem: B.E CSE / II / IV
Sub Code & Sub Name: U15CS412 &Java Programming
UNIT : Unit 3
PART - A
Q.No Questions Marks KL CO
1. What is an exception? 2 K1 CO3
How the exceptions are handled in java? OR Explain
2. 2 K1 CO3
exception handling mechanism in java?
3. Differentiate between error and exception in java? 2 K2 CO3
Can we keep other statements in between try, catch and
4. 2 K1 CO3
finally blocks?
Can we write only try block without catch and finally
5. 2 K1 CO3
blocks?
There are three statements in a try block – statement1,
statement2 and statement3. After that there is a catch
block to catch the exceptions occurred in the try block.
Assume that exception has occurred in statement2. Does
6. 2 K3 CO3
statement3 get executed or not?
7. What is unreachable catch block error? 2 K2 CO3
8. Explain the hierarchy of exceptions in java? 2 K1 CO3
9. What are run time exceptions in java. Give example? 2 K2 CO3
10. What is OutOfMemoryError in java? 2 K1 CO3
11. What are checked and unchecked exceptions in java? 2 K1 CO3
Differentiate between ClassNotFoundException and
12. 2 K1 CO3
NoClassDefFoundError in java?
Can we keep the statements after finally block If the
13. 2 K2 CO3
control is returning from the finally block itself?
Does finally block get executed If either try or catch
14. 2 K1 CO3
blocks are returning the control?
15. Can we throw an exception manually? If yes, how? 2 K1 CO3
16. What is Re-throwing an exception in java? 2 K2 CO3
17. What is the use of throws keyword in java? 2 K2 CO3
Why it is always recommended that clean up operations
like closing the DB resources to keep inside a finally
18. 2 K3 CO3
block?
19. Differentiate between final, finally and finalize in java 2 K2 CO3
20. How do you create customized exceptions in java? 2 K1 CO3
PART – B

Q.No Questions Marks KL CO


(i)Define exception. What are the benefits of exception 8 CO3
1. handling? K3
7
(ii)Briefly explain about Exception hierarchy.
2. Explain the exception handling mechanism with an 15 K3 CO3
example.
(i)Explain the concept of rethrowing exceptions. 8 CO3
3. K4
(ii)Discuss about checked exceptions. 7

4. Discuss the key words of Exception handling mechanism 15 K3 CO3


with example.
(i)Explain exception specification. 8 CO3
5. K3
(ii)Discuss about unchecked exceptions. 7

6. Explain in detail about built in exception? How to create 15 K4 CO3


own exceptions.
7. K4 CO3
8. 15 K4 CO3
What is the problem with below program? CO3

package com.journaldev.exceptions;
import java.io.FileNotFoundException;
import java.io.IOException;
public class TestException {
public static void main(String[] args) {
try {
testExceptions();
} 5 K2
9. catch (FileNotFoundException | IOException e)
{ 10 K4
e.printStackTrace();
} }

public static void testExceptions() throws


IOException, FileNotFoundException{

}
}

What is the problem with below program? CO3


package com.journaldev.exceptions;
import java.io.IOException;
public class TestException4 {
public void start() throws IOException{
}
public void foo() throws
NullPointerException{ 8 K2
10. } 7 K3
}
class TestException5 extends TestException4{
public void start() throws Exception{
}
public void foo() throws RuntimeException{
}
}
Course In-charge Exam Cell Coordinator HOD

You might also like