SCJP试题-SCJPMockExam2

来源:java认证发布时间:2012-11-12 12:48:16java认证视频



Question 14)
Which of the following are valid methods?


1) public static native void amethod(){}
2) public static void ametic native void amethod(){}
3) private protected void amethod(){}
4) static native void amethod();

Answer to Question 14)



--------------------------------------------------------------------------------

Question 15)
Which of the following statements are true?

1) Constructors cannot have a visibility modifier
2) Constructors can be marked public and protected, but not private
3) Constructors can only have a primitive return type
4) Constructors are not inherited


Answer to Question 15)


--------------------------------------------------------------------------------

Question 16)
What will happen when you attempt to compile and run the following class?

class Base{
Base(int i){
System.out.println("Base");
}
}

class Severn extends Base{
public static void main(String argv[]){
Severn s = new Severn();
}
void Severn(){
System.out.println("Severn");
}
}

1) Compilation and output of the string "Severn" at runtime
2) Compile time error
3) Compilation and no output at runtime
4) Compilation and output of the string "Base"


Answer to Question 16)


--------------------------------------------------------------------------------

Question 17)
Which of the following statements are true?


1) static methods do not have access to the implicit variable called this
2) A static method may be called without creating an instance of its class
3) A static method may not be overriden to be non-static
4) A static method may not be overloaded

Answer to question 17)


--------------------------------------------------------------------------------

Question 18)
Which of the following will compile without error?


1)

char c='1';
System.out.println(c>>1);

2)

Integer i=Integer("1");
System.out.println(i>>1);

3)

int i=1;
System.out.println(i<<<1);

4)

int i=1;
System.out.println(i<<1);

Answer to Question 18)


--------------------------------------------------------------------------------

Question 19)
Which of the following are true?

1) A component may have only one event listener attached at a time
2) An event listener may be removed from a component
3) The ActionListener interface has no corresponding Adapter class
4) The processing of an event listener requires a try/catch block


Answer to Question 19)


--------------------------------------------------------------------------------

Question 20)
Which of the following are Java keywords?

1) sizeof
2) main
3) transient
4) volatile

Answer to Question 20)


--------------------------------------------------------------------------------

Question 21)
Which of the following statements are true?

1) The default constructor has a return type of void
2) The default constructor takes a parameter of void
3) The default constructor takes no parameters
4) The default constructor is not created if the class has any constructors of its own.


Answer to Question 21)


视频学习

我考网版权与免责声明

① 凡本网注明稿件来源为"原创"的所有文字、图片和音视频稿件,版权均属本网所有。任何媒体、网站或个人转载、链接转贴或以其他方式复制发表时必须注明"稿件来源:我考网",违者本网将依法追究责任;

② 本网部分稿件来源于网络,任何单位或个人认为我考网发布的内容可能涉嫌侵犯其合法权益,应该及时向我考网书面反馈,并提供身份证明、权属证明及详细侵权情况证明,我考网在收到上述法律文件后,将会尽快移除被控侵权内容。

最近更新

社区交流

考试问答