Java - Static Keyword
What will be the output of the following Java program?
class Counter {
static int total = 0;
Counter() {
total += 2;
}
public static void main(String[] args) {
new Counter();
new Counter();
new Counter();
System.out.println(total);
}
}