Link to home
Start Free TrialLog in
Avatar of KaranGupta
KaranGupta

asked on

cannot find symbol DivideByZeroException

Hi

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

class MutipleCatchDemo
{	
	public void CallMultipleCatch()
	{
			try
			{
				int x = 0;
				int y = 5/x;
			}
			catch(DivideByZeroException e1)
			{
				System.out.println(e1.Message);
			}
	}
	
}

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

Open in new window


What is wrong with the code.
ASKER CERTIFIED SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial