class test_parent
{
int x = 5;
int y = 10;
void set_value(int a, int b)
{
x = a;
y = b;
}
int get_1()
{
return x+y;
}
int get_2()
{
return x - y;
}
}
class test_4 extends test_parent
{
int y;
test_4(int a)
{
y = a;
}
void set_value(int a, int b)
{
x = a;
y = b;
}
int get_2()
{
return y;
}
}
class Test
{
public static void main(String[] args)
{
test_4 a1=new test_4(1);
System.out.println("a1.get_1()="+a1.get_1());
}
}
该程序运行步奏是怎样的?
|
|