public class MyApplication {

    public static void main (String args[]) {

        Counter c1 = new Counter();

        System.out.println("Counter 1 has value "+c1.getValue());

        try {
           for (int i=1; i<10; i++) {
               c1.increment();
               System.out.println("Counter 1 is now "+c1.getValue());
           }
        } catch (CounterException e) {
           System.out.println(e.getErrorMessage());
        }

    }
}
