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

Assignment No.4: Title: Study of Exception Handling in JAVA Aim: Write A C++/Java Program For The Following

This document outlines an assignment to write a Java program that reads two double numbers from keyboard, divides the numbers in a function, and uses exception handling. The program must include try blocks to throw exceptions for invalid data types and divide-by-zero errors, and catch blocks to handle any exceptions thrown from the try blocks. The document also requires an introduction to exception handling in Java and an explanation of keywords related to exceptions.

Uploaded by

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

Assignment No.4: Title: Study of Exception Handling in JAVA Aim: Write A C++/Java Program For The Following

This document outlines an assignment to write a Java program that reads two double numbers from keyboard, divides the numbers in a function, and uses exception handling. The program must include try blocks to throw exceptions for invalid data types and divide-by-zero errors, and catch blocks to handle any exceptions thrown from the try blocks. The document also requires an introduction to exception handling in Java and an explanation of keywords related to exceptions.

Uploaded by

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

Assignment No.

4
Title: Study of Exception Handling in JAVA
Aim: Write a C++/Java program for the following:
1) A function to read two double type numbers from keyboard
2) A function to calculate the division of these two numbers
3) A try block to throw an exception when a wrong type of data is keyed in
4) A try block to detect and throw an exception if the condition divide-by-zero occurs
5) Appropriate catch block to handle the exceptions thrown
Theory:
1) Introduction to Exception Handling in JAVA
2) Explain keywords try, catch, throw, throws, finally
Conclusion:

You might also like