C Sharp (C#) - Inheritance
Given the following classes, which statement is true about accessing the score field?
public class Game {
protected int score = 0;
}
public class Player : Game {
public void IncreaseScore() {
score += 10;
}
}
public class Spectator {
public void ShowScore() {
Game g = new Game();
// Can we access g.score here?
}
}