Created
March 3, 2016 15:05
-
-
Save SamuelSchwent/a0fb3b5757376d95a836 to your computer and use it in GitHub Desktop.
Java - Static Class Members Example
This file contains hidden or 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 Countable | |
| { | |
| private static int instanceCount = 0; | |
| public Countable() | |
| { | |
| instanceCount++; | |
| } | |
| public int getInstaneCount() | |
| { | |
| return instanceCount; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment