الرجوع
تسجيل الدخول

What is the output of the program?

public class Counter {
    int count = 0;

    void increment() {
        count++;
    }

    void decrement() {
        count--;
    }

    public static void main(String[] args) {
        Counter myCounter = new Counter();
        myCounter.increment();
        myCounter.increment();
        myCounter.decrement();
        System.out.println(myCounter.count);
    }
}