当前位置:首页 > 全部子站 > IT > 思科认证

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

来源:长理培训发布时间:2017-12-19 11:28:53
百度广告

   这都是考试原题,有心人可以收集收集,会让你收益匪浅!因为这一套较多,所以我分< 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

责编:罗莉

发表评论(共0条评论)
请自觉遵守互联网相关政策法规,评论内容只代表网友观点,发表审核后显示!

国家电网校园招聘考试直播课程通关班

  • 讲师:刘萍萍 / 谢楠
  • 课时:160h
  • 价格 4580

特色双名师解密新课程高频考点,送国家电网教材讲义,助力一次通关

配套通关班送国网在线题库一套

课程专业名称
讲师
课时
查看课程

国家电网招聘考试录播视频课程

  • 讲师:崔莹莹 / 刘萍萍
  • 课时:180h
  • 价格 3580

特色解密新课程高频考点,免费学习,助力一次通关

配套全套国网视频课程免费学习

课程专业名称
讲师
课时
查看课程
在线题库
面授课程更多>>
图书商城更多>>
在线报名
  • 报考专业:
    *(必填)
  • 姓名:
    *(必填)
  • 手机号码:
    *(必填)
返回顶部