package com.tencent.test;
abstract class A {
/**
* @param args
*/
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);
}
@Override
public void g(int x, int y) {
// TODO Auto-generated method stub
System.out.println(x+y);
}
@Override
public double h(double x) {
// TODO Auto-generated method stub
return x;
}
}
class A2 extends A{
public void g(int x,int y){
System.out.println(x+y);
}
@Override
public void f(int x) {
// TODO Auto-generated method stub
System.out.println(x);
}
@Override
public double h(double x) {
// TODO Auto-generated method stub
return x;
}
}
class A3 extends A{
public double h(double x){
return x;
}
@Override
public void f(int x) {
// TODO Auto-generated method stub
System.out.println(x);
}
@Override
public void g(int x, int y) {
// TODO Auto-generated method stub
System.out.println(x+y);
}
}
public class E {
public static void main(String [] args){
A a=new A1();
a.f(6);
a.g(1, 7);
System.out.println(a.h(1.1));
A b=new A2();
b.f(7);
b.g(2, 8);
System.out.println(b.h(1.2));
A c=new A3();
c.f(8);
c.g(3, 9);
System.out.println(c.h(1.1));
}
}
abstract class A {
/**
* @param args
*/
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);
}
@Override
public void g(int x, int y) {
// TODO Auto-generated method stub
System.out.println(x+y);
}
@Override
public double h(double x) {
// TODO Auto-generated method stub
return x;
}
}
class A2 extends A{
public void g(int x,int y){
System.out.println(x+y);
}
@Override
public void f(int x) {
// TODO Auto-generated method stub
System.out.println(x);
}
@Override
public double h(double x) {
// TODO Auto-generated method stub
return x;
}
}
class A3 extends A{
public double h(double x){
return x;
}
@Override
public void f(int x) {
// TODO Auto-generated method stub
System.out.println(x);
}
@Override
public void g(int x, int y) {
// TODO Auto-generated method stub
System.out.println(x+y);
}
}
public class E {
public static void main(String [] args){
A a=new A1();
a.f(6);
a.g(1, 7);
System.out.println(a.h(1.1));
A b=new A2();
b.f(7);
b.g(2, 8);
System.out.println(b.h(1.2));
A c=new A3();
c.f(8);
c.g(3, 9);
System.out.println(c.h(1.1));
}
}