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

Part A

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)
15 views2 pages

Part A

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

*PART A:*

1. What is an exception in Java?How it is handled,


2. Explain the difference between checked and unchecked exceptions.
3. Define exception hierarchy in Java.
4. Distinguish Exception and Error
5. Create a Java program that reads two numbers from the user and divides the first number
by the second. Handle ArithmeticException for division by zero and display an appropriate
message using try and catch
6. Develop a Java program to handle ArrayIndexOutOfBoundsException.
7. Create a Java program that throws a NullPointerException when trying to access a method
of a null object. Catch this exception and provide a user-friendly message explaining the
issue.
8. What is the role of the finally block in exception handling?
9. Write the syntax for multiple catch with an example.
10. How does the throw keyword differ from throws in Java?
11. Interpret about custom exception in Java.
12. Develop a Java program that uses a user-defined exception to verify age eligibility for the
election process

*PART B:*

1. Explain about exception handling mechanism in java.


2. Discuss the throwing mechanism in java with example.
3. Summarize about built-in exception in detail.
4. Discuss and write a java program an online shopping application.

a. Mention the user input errors should be handled.


b.
c. How would you handle an invalid account number,credit card number,insuffiecient
balance using exception handling?
d. How would you manage a purchase request that exceeds available stock?
e. What exceptions might occur during the order processing phase?
f. How would you handle temporary unavailability of the payment gateway?
g. How would you ensure that user orders are not lost if an exception occurs during
submission?

11. Explain about exception handling mechanism in java.


12. Describe the throwing mechanism in java with example.
13. Discuss and write a java program an online shopping application.
a.Mention the user input errors should be handled.
b.How would you handle an invalid credit card number using exception handling?
c.How would you manage a purchase request that exceeds available stock?
d.What exceptions might occur during the order processing phase?
e.How would you handle temporary unavailability of the payment gateway?
f.How would you ensure that user orders are not lost if an exception occurs during submission?

You might also like