Skip to content

Commit

Permalink
[Week3][Chap10] 다운캐스팅과 주의점 (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
arinming committed Jan 31, 2024
1 parent 00c56e7 commit a969c52
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion 김아린/java-basic/src/poly/basic/CastingMain4.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public static void main(String[] args) {
child1.childMethod(); // 문제 없음

Parent parent2 = new Parent();

Child child2 = (Child) parent2; // 런타임 오류 - ClassCastException
child2.childMethod(); // 실행 불가
}
Expand Down

0 comments on commit a969c52

Please sign in to comment.