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);
|
||||
}
|
||||
}
|
||||
}
|
||||
6
23DEV1.1/TPS2/TP01/Exception/Incomplet/Incomplet.java
Normal file
6
23DEV1.1/TPS2/TP01/Exception/Incomplet/Incomplet.java
Normal file
@@ -0,0 +1,6 @@
|
||||
public class Incomplet {
|
||||
public static void main(String[] args) {
|
||||
byte[] txt = {0x48, 0x65, 0x6C, 0x6C, 0x6F, 0x0D, 0x0A};
|
||||
System.out.write(txt);
|
||||
}
|
||||
}
|
||||
BIN
23DEV1.1/TPS2/TP01/Exception/Plantages/Test1.class
Normal file
BIN
23DEV1.1/TPS2/TP01/Exception/Plantages/Test1.class
Normal file
Binary file not shown.
10
23DEV1.1/TPS2/TP01/Exception/Plantages/Test1.java
Normal file
10
23DEV1.1/TPS2/TP01/Exception/Plantages/Test1.java
Normal file
@@ -0,0 +1,10 @@
|
||||
public class Test1
|
||||
{
|
||||
public static void main(String[] args)
|
||||
{
|
||||
int[] tab = {0,1,2,3,4,5,6,7,8,9};
|
||||
int i = 11;
|
||||
int res = tab[i];
|
||||
System.out.println(res);
|
||||
}
|
||||
}
|
||||
BIN
23DEV1.1/TPS2/TP01/Exception/Plantages/Test2.class
Normal file
BIN
23DEV1.1/TPS2/TP01/Exception/Plantages/Test2.class
Normal file
Binary file not shown.
8
23DEV1.1/TPS2/TP01/Exception/Plantages/Test2.java
Normal file
8
23DEV1.1/TPS2/TP01/Exception/Plantages/Test2.java
Normal file
@@ -0,0 +1,8 @@
|
||||
public class Test2
|
||||
{
|
||||
public static void main(String[] args)
|
||||
{
|
||||
Object res = null;
|
||||
System.out.println(res.toString());
|
||||
}
|
||||
}
|
||||
BIN
23DEV1.1/TPS2/TP01/Exception/Plantages/Test3.class
Normal file
BIN
23DEV1.1/TPS2/TP01/Exception/Plantages/Test3.class
Normal file
Binary file not shown.
9
23DEV1.1/TPS2/TP01/Exception/Plantages/Test3.java
Normal file
9
23DEV1.1/TPS2/TP01/Exception/Plantages/Test3.java
Normal file
@@ -0,0 +1,9 @@
|
||||
public class Test3
|
||||
{
|
||||
public static void main(String[] args)
|
||||
{
|
||||
String i = "ahahahahahahah";
|
||||
int res = Integer.parseInt(i);
|
||||
System.out.println(res);
|
||||
}
|
||||
}
|
||||
16
23DEV1.1/TPS2/TP01/Exception/Plantages/Test4.java
Normal file
16
23DEV1.1/TPS2/TP01/Exception/Plantages/Test4.java
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
public class Test4
|
||||
{
|
||||
public static void main(String[] args)
|
||||
{
|
||||
try
|
||||
{
|
||||
int res;
|
||||
System.out.println(res);
|
||||
}
|
||||
catch(RuntimeException re)
|
||||
{
|
||||
System.out.println(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
23DEV1.1/TPS2/TP01/Exception/Plantages/Test5.class
Normal file
BIN
23DEV1.1/TPS2/TP01/Exception/Plantages/Test5.class
Normal file
Binary file not shown.
8
23DEV1.1/TPS2/TP01/Exception/Plantages/Test5.java
Normal file
8
23DEV1.1/TPS2/TP01/Exception/Plantages/Test5.java
Normal file
@@ -0,0 +1,8 @@
|
||||
public class Test5
|
||||
{
|
||||
public static void main(String[] args)
|
||||
{
|
||||
int res = 15 / 0;
|
||||
System.out.println(res);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user