COMS 1004 study notes ==================
Ch3 Encapsulation ------------------ c++ import java.util.*; public class Main { public static void main(String[] args) { // TODO Auto-generated method stub Scanner in = new Scanner(System.in); Counter A = new Counter(); A.reset(); A.click(); A.click(); int c = A.getValue(); System.out.println(c); } public static class Counter{ private int value; public void click() { value = value + 1; } public int getValue() { return value; } public void reset() { value = 0; } } }