[java]throwing error:You passed invalid value.Exiting.
why?\n\n\nclass ZeroEvenOdd {\n    private int n,i;\n    private Semaphore semaphore_zero, semaphore_even, semaphore_odd; \n    public ZeroEvenOdd(int n) {\n   
why?\n\n```\nclass ZeroEvenOdd {\n    private int n,i;\n    private Semaphore semaphore_zero, semaphore_even, semaphore_odd; \n    public ZeroEvenOdd(int n) {\n        this.n = n;\n        this.i = 1;\n        semaphore_zero = new Semaphore(1);\n        semaphore_even = new Semaphore(0);\n        semaphore_odd = new Semaphore(0);\n    }\n\n    // printNumber.accept(x) outputs "x", where x is an integer.\n    public void zero(IntConsumer printNumber) throws InterruptedException {\n        while(i<=n) {\n            semaphore_zero.acquire();\n            printNumber.accept(0);\n            if (i%2!=0) {\n                semaphore_even.release(); \n            } else {\n                semaphore_odd.release();\n            }\n            semaphore_zero.acquire();\n            i++;\n            semaphore_zero.release();\n        }\n    }\n\n    public void even(IntConsumer printNumber) throws InterruptedException {\n        semaphore_even.acquire();\n        printNumber.accept(i);\n        semaphore_zero.release();\n    }\n\n    public void odd(IntConsumer printNumber) throws InterruptedException {\n        semaphore_odd.acquire();\n        printNumber.accept(i);\n        semaphore_zero.release();\n    }\n}\n```
[]