简单,我试图检查int []距离是否为空。尝试检查int []是否为空Java
为什么这不起作用?
我的代码:
int[] distances = {3,6,7,6,1,8,8,2,3,4,5,9};
if(distances != null && !distances.isEmpty()) {
throw new TransportException("No routes in entry");
}
else {
return distances;
}
返回错误找不到符号 - 方法是空() – user2863323
请阅读关于数组类型的教程 –