So after beginning to understand why exception handling is required. It is also confusing to understand when to use try and catch and when to use throws. Both of them seems to do the same work but in different way. But while using the throws instead of try and catch. How does the exception gets handled. Why is it necessary to use throw Exception, when it doesn't really handles the exception. For example
public void method
{
try
{divide 1/0 }
catch(DivisionByZeroException e)
{do something }
}
AND
public void method throws DivisonByZeroException
{
divide 1/0
}
whats the point of using throws in second method when it doesnt help the method at all and how does it get handled in the real world.