class People{
float hello(int a,int b) {
return a+b;
}
float hello(long a,int b) {
return a+b;
}
}
public class main {
public static void main(String[] args) {
//方法重载
System.out.println("hello");
}
}
example类
public class Example {
public static void main(String[] args) {
People tom=new People();
System.out.println(tom.hello(10, 20));
System.out.println(tom.hello(10L, 20));
//System.out.println(tom.hello(10.0, 20));
}
}