0% found this document useful (0 votes)
5 views2 pages

Assignment On 6.4.2020

The document consists of an assignment on Object-Oriented Programming (OOP) focusing on exceptions in Java and subclasses. It includes multiple-choice questions regarding when exceptions arise, keywords related to exception handling, and definitions of subclasses. Additionally, it presents a Java code snippet to analyze the output related to exception handling.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

Assignment On 6.4.2020

The document consists of an assignment on Object-Oriented Programming (OOP) focusing on exceptions in Java and subclasses. It includes multiple-choice questions regarding when exceptions arise, keywords related to exception handling, and definitions of subclasses. Additionally, it presents a Java code snippet to analyze the output related to exception handling.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Assignment on 6.4.

2020

OOPs(EC 605A)

Q1). When Exceptions in Java does arises in code sequence?

a) Run Time
b) Compilation Time
c) Can Occur Any Time
d) None of the mentioned

Q2.) Which of these keywords is not a part of exception handling?


a) try
b) finally
c) thrown
d) catch

Q3)What will be the output of the following Java program?


1. class exception_handling
2. {
3. public static void main(String args[])
4. {
5. try
6. {
7. System.out.print("Hello" + " " + 1 / 0);
8. }
9. catch(ArithmeticException e)
10. {
11. System.out.print("World");
12. }
13. }
14. }

a) Hello
acb

Q2.) What is subclass in java?

A. A subclass is a class that extends another class

B. A subclass is a class declared inside a class

C. Both above.

D. None of the above.

Q3) If class B is subclassed from class A then which is the correct syntax

A. class B:A{}

B. class B extends A{}

C. class B extends class A{}

D. class B implements A{}

You might also like