Skip to main content
🔮 Output PredictionJV Java Medium⚡+20 XP

Static Method Call

What does this print?

Java
class Counter {
    static int count = 0;
    Counter() { count++; }
}
new Counter(); new Counter(); new Counter();
System.out.println(Counter.count);

🔮 What is the output?