电话:0731-83595998
导航

SCJP试题-SCJPMockExam2

来源: 2017-12-19 10:52

 百度广告

Question 1)
1) float f=1/3; 
3) float f=1.01; 

Answer to Question 1) 

Question 2)

1) NULL 
3) instanceOf 

Answer to Question 2) 

Question 3)

1) System.out.println(1+1); 
3) c

Answer to Question 3) 

Question 4)

1) The garbage collection algorithm in Java is vendor implemented 
3) The default type for a numerical literal with decimal component is a float. 

Answer to Question 4) 

Question 5)

1) I/O in Java can only be performed using the Listener classes 
3) The creation of a named instance of the File class creates a matching file in the underlying operating system only when the close method is called. 

Answer to Question 5) 

Question 6).

1) The instanceof operator can be used to determine if a reference is an instance of a class, but not an interface. 
3) The instanceof operator will only determine if a reference is an instance of a class immediately above in the hierarchy but no further up the inheritance chain 

Answer to Question 6) 

Question 7)

1) An interface can only contain method and not variables 
3) A class may extend only one other class and implement only one interface 

Answer to Question 7)

|||

Question 8)

1) public class MyCalc extends Math 
3) Math.round(9.99,1); 

Answer to Question 8) 

Question 9)

1) run 
3) yield 

Answer to Question 9) 

Question 10)

1) A byte can represent between -128 to 127 
3) A byte can represent between -256 to 256 

Answer to Question 10) 

Question 11)
class Base{ 
System.out.println("Base"); 

public static void main(String argv){ 

1) Compile time error Base is a keyword 
3) Output of Base 

Answer to Question 11) 

Question 12)

public static void main(String parm){ 
}

If you attempt to compile the class and run the program as follows

java myclass hello

What will happen?

1) Compile time error, main is not correctly defined 
3) Compilation and output of java 

Answer to Question 12) 

Question 13)

Which of the following statements are true?

1) If a class has any abstract methods it must be declared abstract itself. 
3) When applied to a class, the final modifier means it cannot be sub-classed 

Answer to Question 13)

|||

Question 14)
1) public static native void amethod(){} 
3) private protected void amethod(){} 

Answer to Question 14)

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

Question 15)

1) Constructors cannot have a visibility modifier 
3) Constructors can only have a primitive return type 
Answer to Question 15) 

Question 16)

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

class Severn extends Base{
Severn s = new Severn();
void Severn(){
}

1) Compilation and output of the string "Severn" at runtime 
3) Compilation and no output at runtime 
Answer to Question 16) 

Question 17)
1) static methods do not have access to the implicit variable called this 
3) A static method may not be overriden to be non-static 

Answer to question 17) 

Question 18)
1)

char c='1'; 
>1);

2)

Integer i=Integer("1"); 
>1);

3)

int i=1; 
2) Performing an unsigned left shift (

编辑推荐:

下载Word文档

温馨提示:因考试政策、内容不断变化与调整,长理培训网站提供的以上信息仅供参考,如有异议,请考生以权威部门公布的内容为准! (责任编辑:长理培训)

网络课程 新人注册送三重礼

已有 22658 名学员学习以下课程通过考试

网友评论(共0条评论)

请自觉遵守互联网相关政策法规,评论内容只代表网友观点!

最新评论

点击加载更多评论>>

精品课程

更多
10781人学习

免费试听更多

相关推荐
图书更多+
  • 电网书籍
  • 财会书籍
  • 其它工学书籍
拼团课程更多+
  • 电气拼团课程
  • 财会拼团课程
  • 其它工学拼团
热门排行

长理培训客户端 资讯,试题,视频一手掌握

去 App Store 免费下载 iOS 客户端