Skip to content

Instantly share code, notes, and snippets.

@cwansart
Created November 4, 2020 16:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cwansart/6c0908a078fe9e25bfd85abde560dae7 to your computer and use it in GitHub Desktop.
Save cwansart/6c0908a078fe9e25bfd85abde560dae7 to your computer and use it in GitHub Desktop.
public class Score {
protected final int score;
public Score(int score) {
this.score = score;
}
public void printScore() {
System.out.println("Not yet implemented");
}
public static void main(String[] args) {
Score s = new Score(42) {
@Override
public void printScore() {
System.out.println("The score is: " + score);
}
};
s.printScore();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment