-1
我有这种方法。我想从一个包含0列表或空值,其中在列表中的数值如下如何从通用列表中删除特定行
rollno name age city street zipcode
1 abc 0 pqr xyz 145202
年龄具有价值为零删除行,我们必须将其删除。任何机构都可以帮我用它我是新的Java?
在下面的代码,我删除行,我再次打印列表
public void validateData(List<Student> studentList) throws InsufficientDataException {
System.out.println(String.valueOf(list));
for (Iterator <Student> iter = list.listIterator(); iter.hasNext();) {
Student a = iter.next();
if (list.contains("null")) {
iter.remove();
}
}
System.out.println(list);
}
什么是'Student'代码读取的Javadoc?它是属性'rollno','name','age','city','street'和'zipcode'的bean吗? – tilois
已经在这里提出http://stackoverflow.com/questions/31112429/how-to-check-whether-data-in-the-list-contains-0-or-null-value-and-remove-that-d/ 31112972#31112972 –