interface Result{
double calculate(double x,double y);
}
class R {
double calculate(int x,double y) {
return x * y;
}
}
class RA extends R implements Result{
public double calculate(double x,double y){
return x / y;
}
public double calculate(int x,int y){
return x - y;
}
}
class Test_2 {
public static void main(String args[]){
Result r = new RA();
System.out.println(r.calculate(12, 6));
RA s = (RA) r;
System.out.println(s.calculate(12, 6));
R rr = new RA();
System.out.println(rr.calculate(12, 6));
}
static {
int a = 50 / 2 + 19 % 4;
System.out.printf("a=%+d\n",a);
}
}
a=+28
2.0
6.0
72.0