public class aman {
void m(double a , int b, int c) {
System.out.println("second");
}
void m(float a , int b, double c) {
System.out.println("first");
}
public static void main(String[] args) {
aman obj = new aman();
obj.m(23, 12, 1);
}
}
Run Code Online (Sandbox Code Playgroud)
这里,方法m()已经重载但我不理解为什么调用是不明确的,因为在第一种方法中只需要进行1次转换,而在第二种方法中,需要进行两次转换.所以,绝对应该调用第一种方法.请说明为什么没有发生这种情况或者我错过了一些规则.