20 lines
280 B
Java
20 lines
280 B
Java
public class Capture
|
|
{
|
|
public int CalculTest(int a)
|
|
{
|
|
int res = a / 0;
|
|
return res;
|
|
}
|
|
public static void main(String[] args)
|
|
{
|
|
try
|
|
{
|
|
int arf = 15;
|
|
System.out.println(CalculTest(arf));
|
|
}
|
|
catch(ArithmeticException ae)
|
|
{
|
|
System.out.println(0);
|
|
}
|
|
}
|
|
} |