这里是代码
import java.util.List;
public class StreamDemo {
public static void main(String[] args) {
List<User> name = new ArrayList<>();
name.add(new User(1,"Avijit","Barua","aavi1234"));
name.add(new User(2,"Mezanul","Haque","mezan1234"));
name.add(new User(3,"Subrata","Nath","subrata1234"));
name.add(new User(4,"Raman","Karmakar","raman1234"));
name.add(new User(5,"Mowdud","Ahmed","mowdud1234"));
}
}
答案 0 :(得分:1)
name.stream()
.filter(p -> p.getFirstName()!="Avijit")
.forEach(p -> System.out.println(p));