Where and why JVM checks that the return type of entry method main(String args[]) is void and not anything else?
问题 I will try to answer both, please correct me if I am wrong: Where: If a static method is being called using Classname .method() or using reflection then it doesn’t matter even if you change the return type of the calling method, the same method will still be called. So JVM probably checks this in one of the native methods of jvm.cpp methodHandle m (THREAD, init_klass->find_method(vmSymbols::object_initializer_name(),> vmSymbols:: void_method_signature() )); if (m.is_null()) { ------ THROW_MSG