0% found this document useful (0 votes)
6 views1 page

Practical No 13 Java

The document contains a Java program demonstrating the implementation of the 'throw' and 'throws' clauses. It includes a class 'Sample' with a main method that computes the result of dividing two integers. The method 'compute' is designed to throw an ArithmeticException if a division error occurs.

Uploaded by

yashkhobare05
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)
6 views1 page

Practical No 13 Java

The document contains a Java program demonstrating the implementation of the 'throw' and 'throws' clauses. It includes a class 'Sample' with a main method that computes the result of dividing two integers. The method 'compute' is designed to throw an ArithmeticException if a division error occurs.

Uploaded by

yashkhobare05
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

Practical no 13:- write programs for implementation of throw,throws clause.

Name:- Yash Milind khobare

Roll no:-25/34-044

class Sample {

public static void main(String[]

args) int a = 5; int b= 10; int

res = compute(a, b);

[Link]("a = " + a );

[Link]("b = " + b );

[Link]("res = " + res);

static int compute (int a, int b) throws ArithmeticException

return (a/b 10);

You might also like