} = new List <Studentas>(); // arba taip (= new List<Studentas>()); /*public Grupe() //taip galima * { * Studentai = new List<Studentas>(); * }*/ public Grupe() { Studentai.Add(new Studentas("labas", "sd", 180, 20, 'v')); Studentai.Add(new Studentas("sveikas", "fdf", 180, 21, 'v')); Studentai.Add(new Studentas("idomu", "dgg", 187, 22, 'm')); Studentai.Add(new Studentas("taiGerai", "fdf", 184, 23, 'm')); Studentai.Add(new Studentas("saunu", "sdad", 186, 24, 'm')); var studentas = new Studentas("TOM", "JERRY", 30, 45, 'v'); Studentai.Add(studentas); }
static void Main(string[] args) { var stud1 = new Studentas("sdads", "asdas", 170, 22, 'v'); var stud2 = new Studentas("fhgjh", "vcbvb", 160, 24, 'v'); var stud3 = new Studentas("sveikas", "labas", 189, 36, 'v'); var stud4 = new Studentas("vbnvm", "nnmn", 177, 124, 'm'); var stud5 = new Studentas("qwrw", "uio", 150, 128, 'm'); stud1.Isvedimas(); stud2.Isvedimas(); stud3.Isvedimas(); stud4.Isvedimas(); stud5.Isvedimas(); Console.WriteLine(); var grupe = new Grupe(); grupe.Isvedimas(); }