Ajout des travaux effectuer
This commit is contained in:
20
23DEV1.1/TPS2/TP01/Exception/Capture/Capture.java
Normal file
20
23DEV1.1/TPS2/TP01/Exception/Capture/Capture.java
Normal file
@@ -0,0 +1,20 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user