using System;
public class Person
{
public String Name { get; set; } = "John";
}
public class Classroom
{
public Person GetTeacher()
{
return null;
}
}
public class Test
{
public static void Main()
{
Classroom classroom = new Classroom();
var teacherName = classroom.GetTeacher()?.Name;
System.Console.WriteLine(teacherName == null);
}
}
dXNpbmcgU3lzdGVtOwpwdWJsaWMgY2xhc3MgUGVyc29uCnsKCXB1YmxpYyBTdHJpbmcgTmFtZSB7IGdldDsgc2V0OyB9ID0gIkpvaG4iOwp9CgpwdWJsaWMgY2xhc3MgQ2xhc3Nyb29tCnsKICAgIHB1YmxpYyBQZXJzb24gR2V0VGVhY2hlcigpCiAgICB7CiAgICAgICAgcmV0dXJuIG51bGw7CiAgICB9Cn0KCnB1YmxpYyBjbGFzcyBUZXN0CnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBNYWluKCkKCXsKCQlDbGFzc3Jvb20gY2xhc3Nyb29tID0gbmV3IENsYXNzcm9vbSgpOwoJCXZhciB0ZWFjaGVyTmFtZSA9IGNsYXNzcm9vbS5HZXRUZWFjaGVyKCk/Lk5hbWU7CgkJU3lzdGVtLkNvbnNvbGUuV3JpdGVMaW5lKHRlYWNoZXJOYW1lID09IG51bGwpOwoJfQp9