ClassCast exception? Hvad gør jeg galt
package student;public class TAStudent extends Student {
private String[] TAClasses;
public TAStudent(String name, String group, String gender, int profeciencyInJava, int cprNumber, String[] TAClasses) {
super(name, group, gender, profeciencyInJava, cprNumber);
this.TAClasses = TAClasses;
}
public String[] getClasses(){
return TAClasses;
}
public void setTAClasses(String[] TAClasses){
this.TAClasses = TAClasses;
}
void display(){
System.out.println("I am a TA");
}
}
ta = (TAStudent) student;
ta.display();