Another Method Example
Another Method Example
MyMath.java:
public class MyMath {
public static int doubleit(int a){
return 2*a;
}
public static int same(int t){
int x = doubleit(t);
double y = MoreMath.half(x);
return (int)y;
}
}
MoreMath.java:
public class MoreMath {
public static double half(double x) {
return x / 2;
}
}
Run:
10
5