まずはもっとも基本的なパターンです。 Personクラスと、それを継承したStudentクラスを、相互にキャストする実験です。 package samples.exception.cls; class Person { } class Student extends Person { } public class ClassCastExceptionTest { public static void main(String[] args) { try { Person p1 = new Student(); Student s1 = (Student)p1; Person p2 = new Person(); Student s2 = (Student)p2; } catch (Exception e) { e.printStackTrace(); } } } C:\JavaMaster\