主题:一个小问题 请大虾回答
class B{
String name;
int age;
public void getDetails(){
System.out.println(name+":"+age) ;
}
public B(String name,int age){
this.name=name;
this.age=age;
}
}
class A extends B{
String depa;
public void getDetails(){
System.out.println(name+":"+age+":manager of the"+depa) ;
}
public A(String x,int y,String z){
name=x;
age=y;
depa=z;
}
}
class Test{
public static void main(String args[]){
B b=new B("zhangsan",23);
A a=new A("lisi",21,"marketing");
B c=new A("wangwu",30,"IT");
a.getDetails();
b.getDetails();
c.getDetails();
}
}
以上代码提示找不到符号,请大伙帮忙。
String name;
int age;
public void getDetails(){
System.out.println(name+":"+age) ;
}
public B(String name,int age){
this.name=name;
this.age=age;
}
}
class A extends B{
String depa;
public void getDetails(){
System.out.println(name+":"+age+":manager of the"+depa) ;
}
public A(String x,int y,String z){
name=x;
age=y;
depa=z;
}
}
class Test{
public static void main(String args[]){
B b=new B("zhangsan",23);
A a=new A("lisi",21,"marketing");
B c=new A("wangwu",30,"IT");
a.getDetails();
b.getDetails();
c.getDetails();
}
}
以上代码提示找不到符号,请大伙帮忙。