cannot find symbol DivideByZeroException

Posted on 2012-09-22
Last Modified: 2012-09-22

When I executing the code below I am getting the error above

class MutipleCatchDemo
	public void CallMultipleCatch()
				int x = 0;
				int y = 5/x;
			catch(DivideByZeroException e1)

class MainClass
	public static void main(String args[])
		MutipleCatchDemo s = new MutipleCatchDemo();

Open in new window

What is wrong with the code.
Question by:KaranGupta
    1 Comment
    LVL 86

    Accepted Solution

    There is no such Exception class. What you want is ArithmeticException

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Suggested Solutions

    I had a project requirement for a displaying a user workbench .This workbench would consist multiple data grids .In each grid the user will be able to see a large number of data. These data grids should allow the user to 1. Sort 2. Export the …
    Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
    Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
    Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now