BCA Semester 3 – OOP in Java – Unit 5: Handling Error/Exceptions (2Hrs)
Comprehensive questions and detailed answers for Unit 5: Handling Error/Exceptions (2Hrs). Perfect for exam preparation and concept clarity.
Why it is important to handle exception in java? Write a program to illustrate the use of exception handling.
Define exception. Explain exception handling mechanism in java with example.
Defined exception. How exceptions are handled in java? Explain with a proper example.
What are exception handling keyword in java? Write java program to illustrate the conceptof NullPointerException and NumberFormatException.
a) What is difference between checked and unchecked exception? Write a java program that willread college name from keyboard and display it on screen. The program should throw an exception when length of college name is more than 50.
b) What are methods used for inter-thread communication? Write a java program to create twothreads so that one thread prints even number and other thread prints odd number between 100 and 200.
How to handle multiple catch blocks for a nested try block? Explain with an example.
Sample Questions
Define exception. Explain exception handling mechanism in java with example.
Defined exception. How exceptions are handled in java? Explain with a proper example.
What are exception handling keyword in java? Write java program to illustrate the conceptof NullPointerException and NumberFormatException.
a) What is difference between checked and unchecked exception? Write a java program that willread college name from keyboard and display it on screen. The program should throw an exception when length
And more questions available on this page.