// Exercise 3: static vs instance members, method overloading
//
// Implement the IdGenerator class below:
//   - static field `count`, starting at 0
//   - static method next(): increments count and returns the NEW value
//     (first call returns 1, second returns 2, ...)
//   - static method reset(): sets count back to 0
//
// Also implement the two overloaded `describe` methods at the bottom of
// main's containing class (see TODOs) to practice overload resolution.

public class java_oop_fundamentals_exercise_3 {

    static class IdGenerator {
        static int count = 0;

        static int next() {
            // TODO: implement
            return 0;
        }

        static void reset() {
            // TODO: implement
        }
    }

    // Overload 1: describe(int) -> "int: " + value
    static String describe(int value) {
        // TODO: implement
        return null;
    }

    // Overload 2: describe(String) -> "String: " + value
    static String describe(String value) {
        // TODO: implement
        return null;
    }

    // --- self-check: do not modify below this line ---
    public static void main(String[] args) {
        boolean ok = true;

        ok &= IdGenerator.next() == 1;
        ok &= IdGenerator.next() == 2;
        ok &= IdGenerator.next() == 3;
        ok &= IdGenerator.count == 3; // shared static state, not per-instance

        IdGenerator.reset();
        ok &= IdGenerator.next() == 1;

        ok &= describe(5).equals("int: 5");
        ok &= describe("hi").equals("String: hi");

        System.out.println(ok ? "PASS" : "FAIL");
    }
}
