This commit is contained in:
Cristian Stancalau 2020-11-09 19:29:12 +02:00
parent ef3f984d8e
commit 5f9cf2c661
1 changed files with 1 additions and 1 deletions

View File

@ -11,7 +11,7 @@ public class CheckedCastsUnitTest {
Animal animal = new Frog();
//A checked downcast to Mammal is incompatible from Frog because Frog is not a subtype of Mammal.
Mammal mammal1 = (Mammal) animal;
Mammal mammal = (Mammal) animal;
}
@Test(expected = ClassCastException.class)