在不考虑对基本类型自动装拆箱(auto-boxing,auto-unboxing),以及可变长参数的情况下选取重载方法;
如果在第 1 个阶段中没有找到适配的方法,那么在允许自动装拆箱,但不允许可变长参数的情况下选取重载方法;
如果在第 2 个阶段中没有找到适配的方法,那么在允许自动装拆箱以及可变长参数的情况下选取重载方法。
jvms8
*invokevirtual
* invokes an instance method of an object, dispatching on the
(virtual) type of the object. This is the normal method dispatch in the Java
programming language.*invokeinterface
* invokes an interface method, searching the methods
implemented by the particular run-time object to find the appropriate method.*invokespecial
* invokes an instance method requiring special handling, whether an
instance initialization method (§2.9), a private method, or a superclass method.*invokestatic
* invokes a class (static) method in a named class.*invokedynamic
* invokes the method which is the target of the call site object
bound to the invokedynamic instruction. The call site object was bound to a
specific lexical occurrence of the invokedynamic instruction by the Java Virtual
Machine as a result of running a bootstrap method before the first execution of
the instruction. Therefore, each occurrence of an invokedynamic instruction has
a unique linkage state, unlike the other instructions which invoke methods.jvms11 (jvms13)
*invokevirtual
* invokes an instance method of an object, dispatching on the
(virtual) type of the object. This is the normal method dispatch in the Java
programming language.*invokeinterface
* invokes an interface method, searching the methods
implemented by the particular run-time object to find the appropriate method.*invokespecial
* invokes an instance method requiring special handling, either an
instance initialization method (§2.9.1) or a method of the current class or its
supertypes.*invokestatic
* invokes a class (static) method in a named class.*invokedynamic
* invokes the method which is the target of the call site object
bound to the invokedynamic instruction. The call site object was bound to a
specific lexical occurrence of the invokedynamic instruction by the Java Virtual
Machine as a result of running a bootstrap method before the first execution of
the instruction. Therefore, each occurrence of an invokedynamic instruction has
a unique linkage state, unlike the other instructions which invoke methods.