高等继续教育 / Java程序设计
题型描述: 纠错题
写出下面程序的运行结果
import java.io.* ;
public class abc
{
public static void main(String args[ ])
{
System.out.println("a="+a+"\nb="+b);
}
}
class SubClass extends SuperClass
{ int c;
SubClass(int aa, int bb, int cc)
{
super(aa, bb);
c=cc;
}
}
class SubSubClass extends SubClass
{ int a;
SubSubClass(int aa, int bb, int cc)
{ super(aa, bb, cc);
A = aa+bb+cc;
}
void show()
{
System.out.println("a="+a+"\nb="+b+"\nc="+c);
}
}
写出下面程序的运行结果
import java.io.* ;
public class abc
{
public static void main(String args[ ])
{
System.out.println("a="+a+"\nb="+b);
}
}
class SubClass extends SuperClass
{ int c;
SubClass(int aa, int bb, int cc)
{
super(aa, bb);
c=cc;
}
}
class SubSubClass extends SubClass
{ int a;
SubSubClass(int aa, int bb, int cc)
{ super(aa, bb, cc);
A = aa+bb+cc;
}
void show()
{
System.out.println("a="+a+"\nb="+b+"\nc="+c);
}
}
参考答案:
佳题速递: