package p1;
public class Lei2_p1{
public int i;
int b=3;
public void show(){
System.out.println("package p1 - 类 Lei2_p1 - show");
}
public static void main(String[] args)
{
Lei2_p1 num1=new Lei2_p1();
num1.show();
}
}
/--------------
package p1;
public class Lei3_p1 extends p4.Lei1_p4{
public int i2;
public void show(){
System.out.println("package p1 - 类 Lei3_p1 - show---"+c);
}
public static void main(String[] args)
{
Lei3_p1 num1=new Lei3_p1();
num1.show();
p4.Lei1_p4 num2=new p4.Lei1_p4();
System.out.println(num2.c);//这里不可以 但换成num1.c就可以
}
}
public class Lei2_p1{
public int i;
int b=3;
public void show(){
System.out.println("package p1 - 类 Lei2_p1 - show");
}
public static void main(String[] args)
{
Lei2_p1 num1=new Lei2_p1();
num1.show();
}
}
/--------------
package p1;
public class Lei3_p1 extends p4.Lei1_p4{
public int i2;
public void show(){
System.out.println("package p1 - 类 Lei3_p1 - show---"+c);
}
public static void main(String[] args)
{
Lei3_p1 num1=new Lei3_p1();
num1.show();
p4.Lei1_p4 num2=new p4.Lei1_p4();
System.out.println(num2.c);//这里不可以 但换成num1.c就可以
}
}