using System.Collections.Generic;
public static void Main()
Console.WriteLine("foo");
var student = new Student("asdf",new List<string>(){"asdf","ags",null});
Console.WriteLine($"Student name is: {student?.Name}");
Console.WriteLine($"First enrolled course is: {student?.Courses?[2]}");
Console.WriteLine($" Student name is: {student.Name}");
if (student.Courses != null)
Console.WriteLine($" First enrolled course is: {student.Courses[2]}");
public string? Name { get; set; }
public List<string> Courses { get; set; }
public Student(string name, List<string> courses)
public void Enroll(string course)