abstract class A{ public abstract void f(int x); public abstract void g(int x,int y); public abstract double h(double x); } class A1 extends A{ public void f(int x){ System.out.println(x); } public void g(int x,int y){ int z=x+y; System.out.println(z); } public double h(double x){ return x*x; } } class A2 extends A{ public void f(int x){ System.out.println("Hello:"+x); } public void g(int x,int y){ int z=x-y; System.out.println(z); } public double h(double x){ return Math.sqrt(x); } } class A3 extends A{ public void f(int x){ System.out.println("你好:"+x); } public void g(int x,int y){ double z=(double)x/y; System.out.println(z); } public double h(double x){ return 1/x; } } public class ZuoYe5_2{ public static void main(String args[ ]){ A a=new A1(); a.f(10); a.g(12,20); System.out.println(a.h(100)); a=new A2(); a.f(10); a.g(12,20); System.out.println(a.h(100)); a=new A3(); a.f(10); a.g(12,20); System.out.println(a.h(100)); } }