In this piece of code, why the compiler is not able to reference the method that has varargs argument from static context. JDK 17 is complaining Cannot make a static reference to the non-static method doSomething(int, int) . Is this a bug or another feature I am not aware of. JDK 8 and JDK 11 dont complain about it! Answer