Created
November 4, 2020 16:18
-
-
Save cwansart/6c0908a078fe9e25bfd85abde560dae7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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