我尝试访问班级chi2 = np.einsum('ijk,ijk->ij',subs,subs) #subs from previous one
,因此我可以使用方法Weapon
,
这就是为什么我在getName()
方法中声明了w1
,但是由于课程getFleetWeaponNames
和Cruiser
没有扩展Destroyer
类我无法投射它们到Weapon
Weapon
错误:
线程中的异常" main" java.lang.ClassCastException: starfleet.Cruiser无法投射到starfleet.Weapon at starfleet.StarfleetManager.getFleetWeaponNames(StarfleetManager.java:102)
public class Cruiser extends Spacecraft implements ISpacecraft
public class Destroyer extends Spacecraft implements ISpacecraft