电话:0731-83595998
导航

SCJP考试题310-025(第二套)

来源: 2017-12-19 11:28
百度广告

   这都是考试原题,有心人可以收集收集,会让你收益匪浅!因为这一套较多,所以我分< 1>< 2>< 3>< 4>.....将他罗列出来!
Leading the way in IT testing and certification tools, www.testking.com 
Given: 
2. public static void main (String args) { 
4. int j = ~i; 
6. } 
What is the decimal value of j at line 5? 
B. 1 
D. –15 
F. An error at line 4 causes compilation to fail. 
Question No: 2 
Integer i = new Integer (42); 
Double d = new Double (42.0); 
A. (i ==1) 
C. (d == 1) 
E. (d.equals (i)) 
Answer: D, E 
Exhibit : 
2. private static int j = 0; 
4. private static boolean methodB(int k) ( 
6. return true; 
7. 
9. boolean b: 
11. b = i < 10 || methodB (8); 
13. 
15. methodA (0); 
17. ) 
What is the result? 
B. The program prints "4" 
D. The program prints "12" 
Answer: B 
Given 
2. Public static void main (String args) ( 
4. ) 
What is the output? 
Question No: 5 
1. public class Foo { 
3. StringBuffer a = new StringBuffer ("A"); 
5. operate (a,b); 
7. ) 
9. x.append {y}; 
11. ) 
What is the result? 
B. The code compiles and prints "A,A". 
D. The code compiles and prints "AB,B". 
F. The code does not compile because "+" cannot be overloaded for StringBuffer. 

Question No: 6 
1. Public class test ( 
3. Text = text.replace ('j' , 'i'); 
5. 
7. text = text.append ("C") 
9. 
11. String textString = new String ("java"); 
13. 
15. BufferReplace (textBuffer); 
17. System.out.printIn (textString + textBuffer); 
19. ) 
Answer: javajavaC
Exhibit: 
2. public static void add3 (Integer i) } 
4. val += 3; 
6. } 
8. public static void main (String args [ ] ) { 
10. add3 (i); 
12. } 
What is the result? 
B. The program prints "0". 
D. Compilation will succeed but an exception will be thrown at line 3. 
Question No: 8 
1. public class ConstOver { 
3. } 
Which two overload the ConstOver constructor? (Choose Two) 
B. Protected int ConstOver ( ) { } 
D. Public Object ConstOver (int x, int y, int z) { } 
Answer: A, C 
Given: 
2. public void setVar (int a, int b, float c) { 
4. } 
A. Private void setVar (int a, float c, int b) { } 
C. Public int setVar (int a, float c, int b) (return a;) 
E. Protected float setVar (int a, int b, float c) (return c;) 
Question No: 10 
1. class BaseClass { 
3. protected float getVar ( ) ( return x;) 
5. class Subclass extends BaseClass ( 
7. //insert code here 
Which two are valid examples of method overriding? (Choose Two) 
B. Public float getVar ( ) { return x;} 
D. Public float getVar ( ) { return x;} 
Answer: B, D 
Which two demonstrate an "is a" relationship? (Choose Two) 
public class Employee extends Person { } 
public class Employee extends Shape { } 
public class Employee extends Color { } 
public class Animal (private Species species;) 
Class Container implements Component ( 

Question No: 12 
A. An anonymous inner class may be declared as final. 
C. An anonymous inner class can implement multiple interfaces. 
E. Construction of an instance of a static inner class requires an instance of the enclosing outer class. 

Question No 13 
1. package foo; 
3. public class Outer ( 
5. ) 
Which statement is true? 
B. An instance of the inner class cannot be constructed outside of package foo. 
D. From within the package bar, an instance of the inner class can be constructed with "new inner()" 
Question No 14 
1. public class enclosingone ( 
3. ) 
5. public static void main (stringargs)( 
7. //insert code here 
9. ) 
A. InsideOnew ei= eo.new InsideOn(); 
C. InsideOne ei = EnclosingOne.new InsideOne(); 
Answer: D 
Exhibit: 
2. int k = 0; 
4. 
6. public static void main(String args) ( 
8. Test test = new test (); 
10.i= Test.k; 
12.) 
14. 
A. Compilation succeeds. 
C. An error at line 9 causes compilation to fail. 
E. An error at line 11 causes compilation to fail. 
Question No 16 
1. //point X 
3. public static void main (Stringargs) throws Exception { 
5. java.io.outputStreamWriter (System.out), true; 
7. } 
Which statement at PointX on line 1 allows this code to compile and run? 
B. Include java.io.PrintWriter; 
D. Include java.io.OutputStreamWriter; 
Answer: A 
Which two statements are reserved words in Java? (Choose Two) 
B. Import 
D. Implement 
Question No 18 
A. Float foo = -1; 
C. Float foo = 42e1; 
E. Float foo = 3.03d; 
Answer: A, D, F

编辑推荐:

下载Word文档

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

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

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

网友评论(共0条评论)

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

最新评论

点击加载更多评论>>

精品课程

更多
10781人学习

免费试听更多

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

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

去 App Store 免费下载 iOS 客户端