JAVA题库:格林模拟试题三(下)(5)

文章作者 100test 发表时间 2007:03:14 17:38:05
来源 100Test.Com百考试题网


question 45)

what will happen when you attempt to compile and run the following code?

public class sandys{

private int court.

public static void main(string argv[]){

        sandys s = new sandys(99).

        system.out.println(s.court).

        }

sandys(int ballcount){

        court=ballcount.

        }

}


1) compile time error, the variable court is defined as private
2) compile time error, s is not initialized when the system.out method is called
3) compilation and execution with no output
4) compilation and run with an output of 99


question 46)

which of the following statements are true?

1) a method cannot be overloaded to be less public in a child class
2) to be overridden a method only needs the same name and parameter types
3) to be overridden a method must have the same name, parameter and return types
4) an overridden method must have the same name, parameter names and parameter types


question 47)

what will happen when you attempt to compile and run the following code?

class base{

base(){

        system.out.println("base").

        }

}



public class checket extends base{

public static void main(string argv[]){

        checket c = new checket().

        super().

        }



checket(){

        system.out.println("checket").  

        }       

}

1) compile time error
2) checket followed by base
3) base followed by checket
4) runtime error



相关文章


技巧心得:J2ME学习札记2
Java基础-创建Java程序中的线程池
SCJP考点总结及SCJP考试要点分享[2]
技巧心得:J2ME学习札记3
JAVA题库:格林模拟试题三(下)(5)
JAVA题库:格林模拟试题三(下)(3)
SCWCD考试心得分享
Java基础-Java语言的Util类详细介绍
Java基础-Java语言的Socket类详细介绍
澳大利亚华人论坛
考好网
日本华人论坛
华人移民留学论坛
英国华人论坛