- 소스
public class MethodOverloaddingTest {
int speed = 10;
public void speedUp(int a){
speed = a;
System.out.println(speed);
}
public int speedUp(int a, int b){
speed = a*b;
return speed;
}
public static void main(String[] args) {
MethodOverloaddingTest mt = new MethodOverloaddingTest();
mt.speedUp(10);
int val = mt.speedUp(10, 10);
System.out.println(val);
}
}