请问这里的foreach方法中在输出中强转型为什么不行?
System.out.println((Course)obj.id+" :"+(Course)obj.name);
我的意思是这样,编译器报错:name cannot be resolved or is not a field
System.out.println((Course)obj.id+" :"+(Course)obj.name);
我的意思是这样,编译器报错:name cannot be resolved or is not a field
2015-10-14
举报