Test{
public static int main(String[] args){
Test h=new Test();
();
}
public void methodA(){
("Best Wishes");
}
}
2. class Test{
public static void main(String[] args){
Test c=new Test();
String s=new String("ello");
(s);
}
public void amethod(String s){
String c=“H”;
c+=s;
(c);
}
}
Test{
static int a=3;
}
final class Second extends Test {
void method(){
(a);
}
}
Top{
static void myTop(){
("Testing myTop method in Top class");
}
}
public class Down extends Top {
void myTop(){
("Testing myTop method in Down class");
}
public static void main(String[] args) {
Top t=new Down();
();
}
}
Super{
int i=0;
Super(String s){
i=10;
}
}
class Sub extends Super{
Sub(String s){
super(s);
i=20;
}
public static void main(String[] args) {
Sub b=new Sub("hello");
();
}
}
1:错误(main方法没有返int类型的值)2:错误(s是串c是字符)3:对4:错误( Top t=new Down(); )5:20
4:是函数重构问题
练习题之程序填空题一
一般回复引用回复返回顶部
Posted:2010年5月20日 8:14:27
1.
puterable{
_____1___ public double __ ;
}
class 梯形 implements puterable 2______
{ double a,b,h;
梯形(double a,double b,double h)
{ =a;
=b;
=h;
}
public double 求面积()
{ return((1/)*(a+b)*h
java考试 来自淘豆网m.daumloan.com转载请标明出处.