?? 中文java技術網scjp考試題310-025(第二套4)91-147-147.htm
字號:
<html>
<head>
<title>中文java技術網::SCJP考試題310-025(第二套<4>)91-147/147</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name='Keywords' content='java SCJP考試題310-025(第二套)91-147/147 '/>
<meta name='Description' content=' 快放寒假咯,向JAVA中文技術網的工作人員問好,向所有訪問該頁面的朋友問好,祝你們天天快樂,心想事成!本人快要回家和家人團聚了,呵呵!將最后的幾題貼出來!
310-025
Leading the way in IT testing and certification tools,QUESTION NO: 92
Given:
1. String foo = “blue”;
2. Boolean[]bar = new Boolean [1];
3. if (bar[0]) {
4. foo = “green”;
5. }
What is the result?
A. Foo has the value of “”
B. Foo has the value of null.
C. Foo has the value of “blue”
D. Foo has the value of “green”
E. An exception is thrown.
F. The code will not compile.
Answer: F
QUESTION NO: 93
Exhibit:
1. public class X {
2. public static void main (String[]args) {
3. String s1 = new String (“true”);
4. Boolean b1 = new Boolean (true);
5. if (s2.equals(b1)) {
6. System.out.printIn(“Equal”);
7.......' />
</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(第二套<4>)91-147/147 </font>
<font size=1 color=gray>閱讀次數2782</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">
快放寒假咯,向JAVA中文技術網的工作人員問好,向所有訪問該頁面的朋友問好,祝你們天天快樂,心想事成!本人快要回家和家人團聚了,呵呵!將最后的幾題貼出來!<br />
310-025<br />
Leading the way in IT testing and certification tools,QUESTION NO: 92<br />
Given:<br />
1. String foo = “blue”;<br />
2. Boolean[]bar = new Boolean [1];<br />
3. if (bar[0]) {<br />
4. foo = “green”;<br />
5. }<br />
What is the result?<br />
A. Foo has the value of “”<br />
B. Foo has the value of null.<br />
C. Foo has the value of “blue”<br />
D. Foo has the value of “green”<br />
E. An exception is thrown.<br />
F. The code will not compile.<br />
Answer: F<br />
QUESTION NO: 93<br />
Exhibit:<br />
1. public class X {<br />
2. public static void main (String[]args) {<br />
3. String s1 = new String (“true”);<br />
4. Boolean b1 = new Boolean (true);<br />
5. if (s2.equals(b1)) {<br />
6. System.out.printIn(“Equal”);<br />
7. }<br />
8. }<br />
9. }<br />
What is the result?<br />
A. The program runs and prints nothing.<br />
B. The program runs and prints “Equal”<br />
C. An error at line 5 causes compilation to fail.<br />
D. The program runs but aborts with an exception.<br />
Answer: A<br />
QUESTION NO: 94<br />
Given:<br />
1. public class Foo {<br />
2. public static void main (String []args) {<br />
3. int i = 1;<br />
4. int j = i++;<br />
5. if ((i>++j) && (i++ ==j)) {<br />
6. i +=j;<br />
7. }<br />
8. }<br />
9. }<br />
What is the final value of i?<br />
A. 1<br />
B. 2<br />
C. 3<br />
D. 4<br />
E. 5<br />
Answer: B<br />
QUESTION NO: 95<br />
Exhibit:<br />
1. public class X {<br />
2. public static void main (String[]args) {<br />
3. string s = new string (“Hello”);<br />
4. modify(s);<br />
5. System.out.printIn(s);<br />
6. }<br />
7.<br />
8. public static void modify (String s) {<br />
9. s += “world!”;<br />
10. }<br />
11. }<br />
What is the result?<br />
E. The program runs and prints “Hello”<br />
F. An error causes compilation to fail.<br />
G. The program runs and prints “Hello world!”<br />
H. The program runs but aborts with an exception.<br />
Answer: A<br />
<br />
QUESTION NO: 96<br />
Which two are equivalent? (Choose Two)<br />
A. 16>4<br />
B. 16/2<br />
C. 16*4<br />
D. 16>>2<br />
E. 16/2^2<br />
F. 16>>>2<br />
Answer: D, E<br />
QUESTION NO: 97<br />
Exhibit:<br />
1. public class X {<br />
2. public static void main (String[]args) {<br />
3. int [] a = new int [1]<br />
4. modify(a);<br />
5. System.out.printIn(a[0]);<br />
6. }<br />
7.<br />
8. public static void modify (int[] a) {<br />
9. a[0] ++;<br />
10. }<br />
11. }<br />
What is the result?<br />
A. The program runs and prints “0”<br />
B. The program runs and prints “1”<br />
C. The program runs but aborts with an exception.<br />
D. An error “possible undefined variable” at line 4 causes compilation to fail.<br />
E. An error “possible undefined variable” at line 9 causes compilation to fail.<br />
Answer: B<br />
<br />
QUESTION NO: 98<br />
Given:<br />
13. public class Foo {<br />
14. public static void main (String [] args) {<br />
15. StringBuffer a = new StringBuffer (“A”);<br />
16. StringBuffer b = new StringBuffer (“B”);<br />
17. operate (a,b);<br />
18. system.out.printIn{a + “,” +b};<br />
19. )<br />
20. static void operate (StringBuffer x, StringBuffer y) {<br />
21. y.append {x};<br />
22. y = x;<br />
23. )<br />
24. }<br />
What is the result?<br />
A. The code compiles and prints “A,B”.<br />
B. The code compiles and prints “A, BA”.<br />
C. The code compiles and prints “AB, B”.<br />
D. The code compiles and prints “AB, AB”.<br />
E. The code compiles and prints “BA, BA”.<br />
F. The code does not compile because “+” cannot be overloaded for stringBuffer.<br />
Answer: B<br />
QUESTION NO: 99<br />
Given:<br />
1. public class X {<br />
2. public static void main (String[] args) {<br />
3. byte b = 127;<br />
4. byte c = 126;<br />
5. byte d = b + c;<br />
6. }<br />
7. }<br />
Which statement is true?<br />
A. Compilation succeeds and d takes the value 253.<br />
B. Line 5 contains an error that prevents compilation.<br />
C. Line 5 throws an exception indicating “Out of range”<br />
D. Line 3 and 4 contain error that prevent compilation.<br />
E. The compilation succeeds and d takes the value of 1.<br />
Answer: B<br />
QUESTION NO: 100<br />
Given:<br />
1. public class WhileFoo {<br />
2. public static void main (String []args) {<br />
3. int x= 1, y = 6;<br />
4. while (y--) {x--;}<br />
5. system.out.printIn(“x=” + x “y =” + y);<br />
6. }<br />
7. }<br />
What is the result?<br />
A. The output is x = 6 y = 0<br />
B. The output is x = 7 y = 0<br />
C. The output is x = 6 y = -1<br />
D. The output is x = 7 y = -1<br />
E. Compilation will fail.<br />
Answer: E<br />
QUESTION NO: 101<br />
Which statement is true?<br />
A. The Error class is a untimeException.<br />
B. No exceptions are subclasses of Error.<br />
C. Any statement that may throw an Error must be enclosed in a try block.<br />
D. Any statement that may throw an Exception must be enclosed in a try block.<br />
E. Any statement that may thro a runtimeException must be enclosed in a try block.<br />
Answer: D<br />
QUESTION NO: 102<br />
Exhibit:<br />
1. int I=1, j=0<br />
2.<br />
3. switch(i) {<br />
4. case 2:<br />
5. j+=6;<br />
6.<br />
7. case 4:<br />
8. j+=1;<br />
9.<br />
10. default:<br />
11. j +=2;<br />
12.<br />
13. case 0:<br />
14. j +=4;<br />
15. }<br />
16.<br />
What is the value of j at line 16?<br />
A. 0<br />
B. 1<br />
C. 2<br />
D. 4<br />
E. 6<br />
Answer: AE<br />
QUESTION NO: 103<br />
Given:<br />
1. switch (i) {<br />
2. default:<br />
3. System.out.printIn(“Hello”);<br />
4. )<br />
What is the acceptable type for the variable i?<br />
A. Byte<br />
B. Long<br />
C. Float<br />
D. Double<br />
E. Object<br />
F. A and B<br />
G. C and D<br />
Answer: A<br />
QUESTION NO: 104<br />
You need to store elements in a collection that guarantees that no duplicates are stored. Which two<br />
interfaces provide that capability? (Choose Two)<br />
A. Java.util.Map<br />
B. Java.util.Set<br />
C. Java.util.List<br />
D. Java.util.StoredSet<br />
E. Java.util.StoredMap<br />
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -