?? 中文java技術網scjp考試題310-025(第二套3)51-91-147.htm
字號:
<html>
<head>
<title>中文java技術網::SCJP考試題310-025(第二套<3>)51-91/147</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name='Keywords' content='java SCJP考試題310-025(第二套)51-91/147 '/>
<meta name='Description' content=' 這是第2套題中的51-90題,只因為上網時間不多!所以只有借個地方粘貼出來!因為題確實太多,所以想要全部題目的給我的郵箱huiwu917@gmial.com 發個信息!寫明SCJP考試試題第2套!
310-025
Leading the way in IT testing and certification tools, www.testking.com
Question No 51
Exhibit:
1. import java.io.IOException;
2. public class ExceptionTest(
3. public static void main (String[]args)
4. try (
5. methodA();
6. ) catch (IOException e) (
7. system.out.printIn(“Caught IOException”);
8. ) catch (Exception e) (
9. system.out.printIn(“Caught Exception”);
10. )
11. )
12. public void methodA () {
13. throw new IOException ();
14. )
15. )
What is the result?
A. The code will not compile.
B. The output is caught exception.
C. The output is caught IOException.
D. The program executes n......' />
</head>
<LINK href="../css/style.css" rel=STYLESHEET type=text/css>
<body leftmargin="0" link="#00000" topmargin="0" oncontextmenu="return true" bgcolor="#666699">
<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#FFFFFF">
<tr>
<td bgcolor="#000000" align="center">
<script language="JavaScript">
function MM_o(selObj){
window.open(selObj.options[selObj.selectedIndex].value);}
function MM_jumpMenu(targ,selObj,restore){ //v3.0
if(selObj.options[selObj.selectedIndex].value!=''){
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
}
</script>
<table width="760" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF" height="84" align="center">
<tr>
<td bgcolor="#000000" rowspan="2"><img src="../images/heard1.jpg" width="110" height="65"></td>
<td rowspan="2" bgcolor="#000000"><img src="../images/heard2.jpg" width="142" height="65"></td>
<td width="615" bgcolor="#000000" bordercolor="0">
<!-- <a href='http://www.cn-java.com/community/' target='_blank'><IMG SRC='http://www.cn-java.com/images/bar.gif' BORDER='0'></a> -->
<div align="center">
<img src=/images/bar.gif>
</div>
</td>
</td>
</tr>
<tr>
<td width="615" bgcolor="#000000" valign="middle" height="17"><a href="http://www.cn-java.com:7001/roller" target='_self'>
<font color="red" size="3" face="Arial, Helvetica, sans-serif"><b>BLOG</b></font></a><font color="#CC9900" size="3" face="Arial, Helvetica, sans-serif">|</font>
<font face="Arial, Helvetica, sans-serif">
<a target='_self' href='../tologin.php'><font color="#FFFFFF" size="2">登錄</font></a>
<font color="#CC9900" size="3">|</font><a target='_self' href='../user_step1.php' ><font size="2" color="#FFFFFF">免費注冊</font></a><font color="#CC9900" size="3">|</font><font face="Arial, Helvetica, sans-serif"><a href='http://www.actionsoft.com.cn' target='_self'><font size="2" color="#FFFFFF"><b><font color="#ffcc00">炎黃盈動</font></b></font></a></font><font color="#CC9900" size="3"><font color="#CC9900" size="3">|</font></font><font face="Arial, Helvetica, sans-serif"><a href="/javaforum" target="_self"><b><font size="2" color="#ffcc00">論壇</font></b></a><font color="#CC9900" size="3">|</font><font face="Arial, Helvetica, sans-serif"><a href="/opensource" target="_self"><font size="2" color="#FFFFFF">開源項目</font></a><font color="#CC9900" size="3">|</font>
<font face="Arial, Helvetica, sans-serif"><a href="http://www.cn-java.com/index.php" target="_self"><font size="2" color="#FFFFFF">主頁</font></a>
</font> </font>
<select class="homepage" onChange="MM_jumpMenu('parent',this,1)" name="select">
<option selected>站點導航</option>
<option value="http://www.cn-java.com">+-首頁</option>
<option value="http://www.cn-java.com/community/">+Java社區</option>
<option value="http://www.cn-java.com/opensource/">+開源項目</option>
<option value="http://www.cn-java.com/eshop/">+JAVA圖書</option>
<option>+-新手入門</option>
<option value="http://www.cn-java.com/index_focus.php?kind=31&title=配置java環境">|-配置JAVA環境</option>
<option value="http://www.cn-java.com/index_news_kind.php?title=新手入門/JAVA語言基礎&kind=32&group=">|-JAVA語言基礎</option>
<option value="http://www.cn-java.com/index_download_kind.php?title=開發工具與教程&kind=&group=01">|-開發工具與教程下載</option>
<option value="http://www.cn-java.com/index_download_kind.php?title=程序代碼&kind=&group=02">|-程序代碼下載</option>
<option value="http://www.cn-java.com/index_news_kind.php?title=新手入門/實用技巧&kind=34">|-實用技巧</option>
<option value="http://www.cn-java.com/index_faq_center.php">|-FAQ abc</option>
<option value="http://www.cn-java.com/index_resource_kind.php">|-學習資源</option>
<option>+專題技術</option>
<option value="http://www.cn-java.com/index_focus.php?kind=12&title=Java線程">|-JAVA線程</option>
<option value="http://www.cn-java.com/index_focus.php?kind=20&title=Socket編程">|-Socket編程</option>
<option value="http://www.cn-java.com/index_focus.php?kind=37&title=應用服務器">|-應用服務器</option>
<option value="http://www.cn-java.com/index_focus.php?kind=38&title=WebService">|-Web
Service</option>
<option value="http://www.cn-java.com/index_focus.php?kind=21&title=J2EE">|-J2EE</option>
<option value="http://www.cn-java.com/index_focus.php?kind=17&title=EJB專題">|-EJB專題</option>
<option value="http://www.cn-java.com/index_focus.php?kind=14&title=JAVA與XML">|-JAVA與XML</option>
<option value="http://www.cn-java.com/index_focus.php?kind=16&title=Servlet與JSP">|-Servlet與JSP</option>
<option value="http://www.cn-java.com/index_focus.php?kind=15&title=Applet與Swing">|-Applet與Swing</option>
<option value="http://www.cn-java.com/index_focus.php?kind=13&title=數據庫專題">|-數據庫專題</option>
<option value="http://www.cn-java.com/index_focus.php?kind=22&title=JavaMail">|-JavaMail</option>
<option value="http://www.cn-java.com/index_focus.php?kind=18&title=Java智能卡">|-Java智能卡</option>
<option value="http://www.cn-java.com/index_focus.php?kind=35&title=J2ME">|-J2ME</option>
<option value="http://www.cn-java.com/index_focus.php?kind=19&title=WAP應用技術">|-WAP應用技術</option>
<option value="http://www.cn-java.com/index_focus.php?kind=04&title=Java認證考試">|-Java認證考試</option>
<option value="http://www.cn-java.com/index_focus.php?kind=36&title=設計模式">|-設計模式</option>
<option value="http://www.cn-java.com/qikan/list.php">+電子期刊</option>
<option>+會員管理</option>
<option value="http://www.cn-java.com/index_user_center.php">|-會員管理中心</option>
<option value="http://www.cn-java.com/postMain.php">|-我的文章中心</option>
<option value="http://www.cn-java.com/webteam/">|-JWT成員</option>
</select>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table border=0 cellpadding=0 cellspacing=0 bgcolor="#FFFFFF" width="98%" align="center">
<tr>
<td valign=top height="69" align=center> <table border=0 cellpadding=0 cellspacing=0 bgcolor="#FFFFFF" width="100%">
<tr>
<td valign=top height="69">
<table width="95%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="99%">
<td width="1%">
<tr>
<td width="99%"> <br>
<p><font color=#000000 face="宋體,Arial, Helvetica, sans-serif"
size=2> </font><font color=#000000 face="黑體,Arial, Helvetica, sans-serif"
size=4>
SCJP考試題310-025(第二套<3>)51-91/147 </font>
<font size=1 color=gray>閱讀次數2183</font> <p align='right'>出處 CN-JAVA原創:huiwu917 </p> </p>
<hr noshade>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="86%" valign="top">
這是第2套題中的51-90題,只因為上網時間不多!所以只有借個地方粘貼出來!因為題確實太多,所以想要全部題目的給我的郵箱huiwu917@gmial.com 發個信息!寫明SCJP考試試題第2套!<br />
310-025<br />
Leading the way in IT testing and certification tools, www.testking.com<br />
Question No 51<br />
Exhibit:<br />
1. import java.io.IOException;<br />
2. public class ExceptionTest(<br />
3. public static void main (String[]args)<br />
4. try (<br />
5. methodA();<br />
6. ) catch (IOException e) (<br />
7. system.out.printIn(“Caught IOException”);<br />
8. ) catch (Exception e) (<br />
9. system.out.printIn(“Caught Exception”);<br />
10. )<br />
11. )<br />
12. public void methodA () {<br />
13. throw new IOException ();<br />
14. )<br />
15. )<br />
What is the result?<br />
A. The code will not compile.<br />
B. The output is caught exception.<br />
C. The output is caught IOException.<br />
D. The program executes normally without printing a message.<br />
Answer: A<br />
Question No 52<br />
Exhibit:<br />
1. public class test {<br />
2. public static string output = “”<br />
3.<br />
4. public static void foo(int i) {<br />
5. try {<br />
6. if(i= =1) {<br />
7. throw new Exception ();<br />
8. }<br />
9. output += “1”;<br />
10. )<br />
11. catch(Exception e) {<br />
12. output += “2”;<br />
13. return;<br />
14. )<br />
15. finally (<br />
16. output += “3”;<br />
17. )<br />
18. output += “4”;<br />
19. )<br />
20.<br />
21. public static void main (string args[]) (<br />
22. foo(0);<br />
23. foo(1);<br />
24.<br />
25. )<br />
26. )<br />
What is the value of the variable output at line 24?<br />
Answer: 13423<br />
Question No 53<br />
Given:<br />
1. public class Foo implements Runnable (<br />
2. public void run (Thread t) {<br />
3. system.out.printIn(“Running.”);<br />
4. }<br />
5. public static void main (String[] args) {<br />
6. new thread (new Foo()).start();<br />
7. )<br />
8. )<br />
What is the result?<br />
A. An exception is thrown.<br />
B. The program exists without printing anything.<br />
C. An error at line 1 causes compilation to fail.<br />
D. An error at line 2 causes the compilation to fail.<br />
E. “Running” is printed and the program exits.<br />
Answer: D<br />
Question No 54<br />
Which statement is true?<br />
A. If only one thread is blocked in the wait method of an object, and another thread executes the<br />
modify on that same object, then the first thread immediately resumes execution.<br />
B. If a thread is blocked in the wait method of an object, and another thread executes the notify<br />
method on the same object, it is still possible that the first thread might never resume execution.<br />
C. If a thread is blocked in the wait method of an object, and another thread executes the notify<br />
method on the same object, then the first thread definitely resumes execution as a direct and sole<br />
consequence of the notify call.<br />
D. If two threads are blocked in the wait method of one object, and another thread executes the notify<br />
method on the same object, then the first thread that executed the wait call first definitely resumes<br />
execution as a direct and sole consequence of the notify call.<br />
Answer: B<br />
Question No 55<br />
Which two CANNOT directly cause a thread to stop executing? (Choose Two)<br />
A. Calling the yield method.<br />
B. Calling the wait method on an object.<br />
C. Calling the notify method on an object.<br />
D. Calling the notifyAll method on an object.<br />
E. Calling the start method on another Thread object.<br />
Answer: C, D<br />
Question No 56<br />
Which two can be used to create a new Thread? (Choose Two)<br />
A. Extend java.lang.Thread and override the run method.<br />
B. Extend java.lang.Runnable and override the start method.<br />
C. Implement java.lang.thread and implement the run method.<br />
D. Implement java.lang.Runnable and implement the run method.<br />
E. Implement java.lang.Thread and implement the start method.<br />
Answer: A, D<br />
<br />
Question No 54<br />
Which statement is true?<br />
A. If only one thread is blocked in the wait method of an object, and another thread executes the<br />
modify on that same object, then the first thread immediately resumes execution.<br />
B. If a thread is blocked in the wait method of an object, and another thread executes the notify<br />
method on the same object, it is still possible that the first thread might never resume execution.<br />
C. If a thread is blocked in the wait method of an object, and another thread executes the notify<br />
method on the same object, then the first thread definitely resumes execution as a direct and sole<br />
consequence of the notify call.<br />
D. If two threads are blocked in the wait method of one object, and another thread executes the notify<br />
method on the same object, then the first thread that executed the wait call first definitely resumes<br />
execution as a direct and sole consequence of the notify call.<br />
Answer: B<br />
Question No 55<br />
Which two CANNOT directly cause a thread to stop executing? (Choose Two)<br />
A. Calling the yield method.<br />
B. Calling the wait method on an object.<br />
C. Calling the notify method on an object.<br />
D. Calling the notifyAll method on an object.<br />
E. Calling the start method on another Thread object.<br />
Answer: C, D<br />
Question No 56<br />
Which two can be used to create a new Thread? (Choose Two)<br />
A. Extend java.lang.Thread and override the run method.<br />
B. Extend java.lang.Runnable and override the start method.<br />
C. Implement java.lang.thread and implement the run method.<br />
D. Implement java.lang.Runnable and implement the run method.<br />
E. Implement java.lang.Thread and implement the start method.<br />
Answer: A, D<br />
<br />
Question No 57<br />
Given:<br />
1. public class SyncTest (<br />
2. private int x;<br />
3. private int y;<br />
4. private synchronized void setX (int i) (x=1;)<br />
5. private synchronized void setY (int i) (y=1;)<br />
6. public void setXY(int 1)(set X(i); setY(i);)<br />
7. public synchronized Boolean check() (return x !=y;)<br />
8. )<br />
Under which conditions will check () return true when called from a different class?<br />
A. Check() can never return true.<br />
B. Check() can return true when setXY is called by multiple threads.<br />
C. Check() can return true when multiple threads call setX and setY separately.<br />
D. Check() can only return true if SyncTest is changed to allow x and y to be set separately.<br />
Answer: B<br />
Question No 58<br />
Exhibit:<br />
1. class A implements runable (<br />
2. int i;<br />
3. public void run () (<br />
4. try (<br />
5. thread.sleep(5000);<br />
6. i= 10;<br />
7. ) catch(InterruptedException e) {}<br />
8. )<br />
9. )<br />
10.<br />
11. public class Test {<br />
12. public static void main (string args[]) (<br />
13. try (<br />
14. A a = new A ();<br />
15. Thread t = new Thread (a);<br />
16. t.start();<br />
17.<br />
18. int j= a.i;<br />
19.<br />
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -