LogiQuest
Back to Classes and Objects
8

What is the output of the following program?

var p = new Person("Asha");
Console.WriteLine(p.Greet());
class Person
{
    private readonly string name;
    public Person(string n) { name = n; }
    public string Greet() => "Hi " + name;
}
Easy

Discussion (0)

  • No discussion yet. Ask a doubt or share a shortcut.

Log in to join the discussion.