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(int value) { this.value = value; } public void increment() { value++; } public int getValue() { return value; }}public class Main { public static void main(String[] args) { Counter c1 = new Counter(5); Counter c2 = c1; c1.increment(); c1 = new Counter(10); c2.increment(); System.out.println(c1.getValue()); System.out.println(c2.getValue()); }}