public class ClickerCounter { // Class definition (instance members) int count; void click(){ count++; } void reset(){ count = 0; } // Program's main method that uses the class public static void main(String[] args) { var myCounter = new ClickerCounter(); // instantiate a ClickerCounter myCounter.reset(); // count is 0 myCounter.click(); // count is 1 System.out.println(myCounter.count); myCounter.click(); // count is 2 myCounter.click(); // count is 3 System.out.println(myCounter.count); myCounter.reset(); // count is 0 System.out.println(myCounter.count); } }