【Java-27】Java常见错误记录

1.强转型时候应该使用().func

例如是正确的:

String  str=((student)iter.next()).name;

是错误的

String  str=(student)(iter.next()).name;
String  str=(student)iter.next().name;

猜你喜欢

转载自blog.csdn.net/weixin_42034217/article/details/86379915