LogiQuest
Back to Classes and Objects
7

What is the output of the following program?

var c = new Counter();
c.Add(); c.Add();
Console.WriteLine(c.Value);
class Counter
{
    public int Value { get; private set; }
    public void Add() => Value++;
}
Easy

Discussion (0)

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

Log in to join the discussion.