SCJP试题-SCJPMockExam2
百度广告
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 (
编辑推荐:
温馨提示:因考试政策、内容不断变化与调整,长理培训网站提供的以上信息仅供参考,如有异议,请考生以权威部门公布的内容为准! (责任编辑:长理培训)
-
国家电网30270试题
-
湖南中烟7463试题
-
湖南统招专升本不连网,流畅做题
-
长沙理工大学考研培训4532试题
已有 22658 名学员学习以下课程通过考试
精品课程
更多- 电网书籍
- 财会书籍
- 其它工学书籍
- 电气拼团课程
- 财会拼团课程
- 其它工学拼团
-
- 长理培训微信公众号
- 每日推送精彩考试资讯
长按二维码识别
微信搜索“ 长理培训”
-
- 加入QQ群一起来考国网!
- QQ群号:223940140
点击进入
长理培训客户端 资讯,试题,视频一手掌握
去 App Store 免费下载 iOS 客户端
点击加载更多评论>>