马老师互联网三高七班
public class Cat {
public static void main(String[] args) {
Cat cat = new Cat();
cat.fn(1); // 优先匹配 -> int i
// 以下匹配顺序为 int > Integer > Number > Object
cat.fn((Integer) null); // 此处强制为 null 指定类型即可 -> 强制类型转换
}
void fn(int i) {}
void fn(Integer i) {}
void fn(Number i) {}
void fn(Object i) {}
void fn(Object[] i){}}