public IntList Filter(IntPredicate p) { IntList res = new IntList(); foreach (int i in this) { if (p(i)) { res.Add(i); } } return(res); }
//Further, use anonymous methods to write an expression that prints only those list elements that are //greater than or equal to 25. public IntList GreaterThan(IntPredicate p) { IntList result = new IntList(); foreach (int i in this) { if (i >= 25) { result.Add(i); } } return(result); }