What is the output of the following code? public class Count…
What is the output of the following code? public class Counter {private int value; public Counter() { value = 0;}public void increment() { value = value + 1;}public int getValue() { return value;}}public class Main {public static void main(String[] args) {Counter c = new Counter();c.increment();c.increment();System.out.println(c.getValue());}}