A class has `public static void main(String[] args)` spelled exactly right, but a teammate insists the JVM "calls main the way any Java code calls a method," with a special compiler-generated hook. Is that accurate, and what actually happens instead?
It's not accurate. After a class is loaded, verified and linked, the java launcher has no special compiler-generated hook pointing at main — it finds the entry point the same way any Java code would look up a method it only knows the name of: through reflection. It calls the equivalent of Class.getMethod("main", String[].class) on the class you named, checks that what comes back is both public and static, and then invokes it with Method.invoke(null, argsArray) — null because there's no instance to call it on, which is exactly why static is required in the first place. That's also why the signature has to match precisely: reflective lookup by name and parameter type isn't fuzzy, so a wrong name or a missing modifier both mean the lookup simply finds nothing.