C Sharp (C#) - Classes and Objects
What will be printed when the following C# code is executed?
class ScoreTracker {
private int score = 0;
public void AddPoint() { score += 2; }
public int GetScore() { return score; }
}
var tracker = new ScoreTracker();
tracker.AddPoint();
tracker.AddPoint();
Console.WriteLine(tracker.GetScore());