This commit is contained in:
Cristian Stancalau 2020-10-12 16:37:08 +03:00
parent 4c748f7a23
commit 6a82d1cde6
1 changed files with 1 additions and 4 deletions

View File

@ -5,16 +5,13 @@ import java.io.Serializable;
public class Main {
public static void main(String[] args) {
checkedCasts();
uncheckedConversion();
genericConversion();
}
private static void checkedCasts() {
Animal animal = new Frog();
try {
Mammal mammal = (Mammal) animal;
} catch (ClassCastException e) {
@ -28,7 +25,6 @@ public class Main {
}
Object primitives = new int[1];
try {
Integer[] integers = (Integer[]) primitives;
} catch (ClassCastException e) {
@ -94,4 +90,5 @@ public class Main {
this.content = content;
}
}
}