Created
December 5, 2017 18:24
-
-
Save Krisztiaan/104105d456f5fea7de81b09c2348e3e2 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 CounterClass { | |
private static counter = 0; | |
public static int getInstanceCount() { | |
return CounterClass.counter; | |
} | |
// final, ha leszármazunk belöle, akkor is muszáj legyen számolnia | |
public final CounterClass() { | |
CounterClass.counter++; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment