//BWtv.java 父类的定义
public class BWtv{
private int a;
public BWtv(){
a=1;
}
public changeBWtv(int i){
a=i;
}
}
//Ctv.java 子类的定义
class Ctv exntends BWtv{ //注意关键字“extends”
private int b;
public Ctv(){
b=2;
}
public changetCv(int x){
b = x;
}
}
延伸阅读
文章来源于领测软件测试网 https://www.ltesting.net/