using System; namespace _06GenericList { class Person : IComparable { string name, vorname; public Person(string name, string vorname) { this.name = name; this.vorname = vorname; } public int CompareTo(Person other) { return (name + vorname).CompareTo(other.name + other.vorname); } public override string ToString() => $"{name}, {vorname}"; } class Program { static void Main(string[] args) { Liste il = new Liste(); il.AddEnd(10); il.AddEnd(20); il.AddEnd(23); il.AddEnd(21); il.AddEnd(35); il.AddEnd(40); foreach (var item in il.Filter(x => x%2==0)) { Console.WriteLine(item); } //il.Print(); Console.WriteLine("*****************"); Liste sl = new Liste(); sl.AddSorted("Emil"); sl.AddSorted("Anton"); sl.AddSorted("Berta"); sl.AddSorted("Dieter"); foreach (var item in sl.Filter(x=>x.Contains("er"))) { Console.WriteLine(item); } Console.WriteLine("*****************"); sl.Print(); Liste pl = new Liste(); pl.AddSorted(new Person("Meier", "Emil")); pl.AddSorted(new Person("Schmitt", "Anton")); pl.Print(); Liste> pll = new Liste>(); pll.AddSorted(pl); } } }