package test0711;
class A
{
public final static int x = 1000;;
void prints()
{
System.out.println(x);
}
}
class B extends A
{
void print2s()
{
System.out.println("very good");
}
}
public class test0712 {
public static void main(String[] arg)
{
A test = new B(); //这句代码体现了类的什么性质
test.prints();
B test1 = new B();
test1.print2s();
}
|
|