C Sharp (C#) - Properties and Encapsulation
What will be the output of this C# code?
class Person {
private string _name = "Alice";
public string Name { get => _name; }
}
var p = new Person();
Console.WriteLine(p.Name);What will be the output of this C# code?
class Person {
private string _name = "Alice";
public string Name { get => _name; }
}
var p = new Person();
Console.WriteLine(p.Name);15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions