分类信息
各地考试

当前位置:首页 » Java认证 » 历年真题 » 正文

SCJP认证历年经典考题(8)


时间:2013-10-22 来源:Java认证考试网 浏览次数:79  【华夏培训网:中国教育培训第一门户

QuestionNo31 Given: 1.publicclassreturnIt( 2.returnTypemethodA(bytex,doubley)( 3.return(short)x/y*2; 4.) 5.) Whatisthev

Question No 31 
Given: 
1. public class returnIt ( 
2. returnType methodA(byte x, double y) ( 
3. return (short) x/y * 2; 
4. ) 
5. ) 
What is the valid returnType for methodA in line 2? 
A. Int 
B. Byte 
C. Long 
D. Short 
E. Float 
F. Double 
Answer: F 

Question No 32 
Given the ActionEvent, which method allows you to identify the affected component? 
A. GetClass. 
B. GetTarget. 
C. GetSource. 
D. GetComponent. 
E. GetTargetComponent. 
Answer: C 

Question No 33 
Which is a method of the MouseMotionListener interface? 
A. Public void mouseMoved(MouseEvent) 
B. Public boolean mouseMoved(MouseEvent) 
C. Public void mouseMoved(MouseMotionEvent) 
D. Public boolean MouseMoved(MouseMotionEvent) 
E. Public boolean mouseMoved(MouseMotionEvent) 
Answer: A 

Question No 34 
Exhibit: 
1. import java.awt*; 
2. 
3. public class X extends Frame ( 
4. public static void main(string args) ( 
5. X x = new X (); 
6. X.pack(); 
7. x.setVisible(true); 
8. ) 
9. 
10. public X () ( 
11. setlayout (new GridLayout (2,2)); 
12. 
13. Panel p1 = new panel(); 
14. Add(p1); 
15. Button b1= new Button (“One”); 
16. P1.add(b1); 
17. 
18. Panel p2 = new panel(); 
19. Add(p2); 
20. Button b2= new Button (“Two”); 
21. P2.add(b2); 
22. 
23. Button b3= new Button (“Three”); 
24. add(b3); 
25. 
26. Button b4= new Button (“Four”); 
27. add(b4); 
28. ) 
29. ) 





       Java认证

推荐图文

热门点击排行

©2015 hxpx.com All Rights Reserved 滇ICP备13002816号-1
华夏培训网唯一网址www.hxpx.com