Skip to content

Instantly share code, notes, and snippets.

@azhuox
Created December 2, 2020 03:39
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 azhuox/209229bc0336ee8f63c3eda983aa6f8d to your computer and use it in GitHub Desktop.
Save azhuox/209229bc0336ee8f63c3eda983aa6f8d to your computer and use it in GitHub Desktop.
public class Counter {
// counter variable, only visible in the class.
private int counter;
public Counter() {
this.counter = 0;
}
// N - return current counter's value.
public int N() {
return this.counter;
}
// Other methods are omitted.
......
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment