getValue() ;
/**
*
* < >
*
* @author kWX14579
* @version [ , 2009-5-6]
* @see [ / ]
* @since [ / ]
*/
public class A
{
private int x;
private int y;
/**
* @return x
*/
public int getX()
{
return x;
}
/**
* @param x
*/
public void setX(int x)
{
this.x = x;
}
/**
* @return y
*/
public int getY()
{
return y;
}
/**
* @param y
*/
public void setY(int y)
{
this.y = y;
}
// ;
public void getValue()
{
System.out.println("aaa");
}
public static void main(String[] args)
{
// TODO Auto-generated method stub
A a = new A();
B b = new B();
b.setC(1);
A a1 = (A)b; // ( ) ;
A a2 = new B(); // ( ) ;
//B b1 = (B)a; // ;
a1.getValue();
a2.getValue();
}
}
public class B extends A
{
private int c ;
/**
* @return c
*/
public int getC()
{
return c;
}
/**
* @param c
*/
public void setC(int c)
{
this.c = c;
}
public void getValue()
{
System.out.println("bbbb");
}
}