📄 解析6.htm
字号:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<Meta http-equiv="Pragma" Content="No-cach">
<title>SCJP认证套题解析之六 -- 最大的IT资源网</title>
<link href="/img/P5-06-css.css" rel="stylesheet" type="text/css">
</head>
<script language="JavaScript">
function GetContentWnd(){ return parent; }
function OnSave(){
var oWnd = GetContentWnd();
window.external.addFavorite(
oWnd.location.href, oWnd.document.title );
}
//双击鼠标滚动屏幕的代码
var currentpos,timer;
function initialize()
{
timer=setInterval ("scrollwindow()",80);
}
function sc()
{
clearInterval(timer);
}
function scrollwindow()
{
currentpos=document.body.scrollTop;
window.scroll(0,++currentpos);
if (currentpos !=document.body.scrollTop)
sc();
}
document.onmousedown=sc
document.ondblclick=initialize
</script>
<Script LANGUAGE="JavaScript">
if(self!=top){top.location=self.location;}
</script>
<body oncontextmenu="return false;" onload="setimg();">
<table width="750" border="0" align="center" cellpadding="0"
cellspacing="0">
<tr>
<td height="26" valign="top"><table width="100%" border="0"
cellpadding="0" cellspacing="0">
<tr>
<td height="22" align="center"><script src="/js/P5-head.js"></script></td>
</tr>
</table></td>
</tr>
<tr>
<td height="82" align="center" valign="top"
bgcolor="#D2D2D2"><table width="750" border="0" cellpadding="0"
cellspacing="0">
<tr>
<td height="80" align="center" bgcolor="#FFFFFF"><script src="/ad/k15-5-1.js"></script></td>
</tr>
</table></td>
</tr>
<tr>
<td height="30" valign="top"><table width="100%" border="0"
cellpadding="0" cellspacing="0">
<tr>
<td width="85" height="30"><img src="/img/P5-06-01.gif"
width="85" height="30"></td>
<td width="85"><a href="javascript:OnSave();"><img
src="/img/P5-06-02.gif" width="85" height="30" border="0"></a></td>
<td width="8" align="center" valign="top"><img src="/img/P5-06
-03.gif" width="8" height="8"></td>
<td width="8" align="left" valign="bottom"
bgcolor="#F2F2F2"><img src="/img/P5-06-04.gif" width="8"
height="8"></td>
<td width="10" bgcolor="#F2F2F2"> </td>
<td width="418" bgcolor="#F2F2F2"><a href="/">豆豆首页</a> - <a href="http://www.ddvip.net/index.htm">在线教程</a> - <a href="/cert/index.htm">认证考试</a> - <a href="/cert/java/index.htm">JAVA认证</a> - <a href="/cert/java/index3/index.htm">培训资源</a></td>
<td width="136" bgcolor="#F2F2F2"><marquee scrollamount="4">最
大的中文IT资源网
</marquee></td>
</tr>
</table></td>
</tr>
<tr>
<td><table width="100%" border="0" align="left" cellpadding="0"
cellspacing="0">
<tr>
<td valign="top"><table width="100%" border="0"
cellpadding="0" cellspacing="0">
<tr>
<td align="center"> </td>
<td width="20" rowspan="2"> </td>
</tr>
<tr>
<td height="50" align="center" style="border-bottom:1px
dashed #666666"><strong class="f16">SCJP认证套题解析之六</strong></td>
</tr>
<tr>
<td height="40" align="center"> 作者:unknown 更新时间:
2005-03-22 </td>
<td rowspan="6" valign="top" style="border-right:1px solid
#666666"> </td>
</tr>
<tr>
<td height="40"> </td>
</tr>
<tr>
<td><table width="100%" border="0" cellpadding="0"
cellspacing="0" class="pagefont">
<tr>
<td><p class="line-height"><br>
26、Which of the following statements about declaration are true? <br>
A. Declaration of primitive types such as boolean, byte and so on does not allocate memory space for the variable. <br>
<br>
B. Declaration of primitive types such as boolean, byte and so on allocates memory space for the variable. <br>
<br>
C. Declaration of nonprimitive types such as String, Vector and so on does not allocate memory space for the object. <br>
<br>
D. Declaration of nonprimitive types such as String, Vector ans so on allocates memory space for the object. <br>
<br>
(ad) <br>
<br>
题目:下面的有关声明的哪些叙述是对的。 <br>
A. 对原始数据类型例如boolean,byte的变量的声明不会为该变量分配内存空间。 <br>
<br>
B. 对原始数据类型例如boolean,byte的变量的声明将为之分配内存空间。 <br>
<br>
C. 非原始数据类型例如String,Vector的变量的声明不会为该对象分配内存。 <br>
<br>
D. 非原始数据类型例如String,Vector的变量的声明会为该对象分配内存。 <br>
<br>
对原始数据类型的变量的声明将为之分配内存并赋予一个缺省值,参见23题的叙述,而非原始数据类型的变量必须用new Xxxx()分配内存及初始化。但是严格来讲此题的答案有待确定,因为只有原始类型的实例变量和类变量的声明在类对象被创建/类被加载时完成内存的自动分配,而原始类型的局部变量必须显式初始化,从这点来看原始类型的局部变量没有被自动分配内存,SL275中只提出了非原始数据类型的变量必须使用new Xxxx()完成内存的分配而没有指出原始数据类型的变量是否在声明时即自动进行内存分配,而从局部变量不能在显式初始化前使用这点来看在声明时没有进行内存分配。因此答案a的正确性还有待官方的确定。 <br>
<br>
27、In the Java API documentation which sections are included in a class document? <br>
A. The description of the class and its purpose <br>
<br>
B. A list of methods in its super class <br>
<br>
C. A list of member variable <br>
<br>
D. The class hierarchy <br>
<br>
(acd) <br>
<br>
题目:在Java API文档中下面的哪些部分被包括在内 <br>
A. 类及用途的描述 <br>
<br>
B. 父类的方法的列表 <br>
<br>
C. 成员变量的列表 <br>
<br>
D. 类层次 <br>
<br>
类文档的内容主要是:类层次、类及用途描述、成员变量列表、构造方法列表、成员方法列表、从类层次上继承的方法列表、成员变量的详细说明、构造方法详细说明、成员方法详细说明。 <br>
<br>
28、Given the following code: <br>
1) public void modify() { <br>
<br>
2) int i, j, k; <br>
<br>
3) i = 100; <br>
<br>
4) while ( i > 0 ) { <br>
<br>
5) j = i * 2;
</p>
<p class="line-height"> 6) System.out.println (" The value of j is " + j ); <br>
<br>
7) k = k + 1; <br>
<br>
8) i--; <br>
<br>
9) } <br>
<br>
10) } <br>
Which line might cause an error during compilation? <br>
A. line 4 <br>
<br>
B. line 6 <br>
<br>
C. line 7 <br>
<br>
D. line 8 <br>
<br>
(c) <br>
<br>
题目:给出下面的代码: <br>
… <br>
哪些行在编译时可能产生错误。 <br>
<br>
这个问题在前面有关变量的类型及其作用域的问题中讨论过,局部变量在使用前必须显式初始化,而代码中的变量k在使用前没有。 <br>
<br>
29、Which of the following statements about variables and scope are true? <br>
A. Local variables defined inside a method are destroyed when the method is exited. <br>
<br>
B. Local variables are also called automatic variables. <br>
<br>
C. Variables defined outside a method are created when the object is constructed. <br>
<br>
D. A method parameter variable continues to exist for as long as the object is needed in which the method is defined. <br>
<br>
(abc) <br>
<br>
题目:下面有关变量及其作用域的陈述哪些是对的。 <br>
A. 在方法里面定义的局部变量在方法退出的时候被撤销。 <br>
<br>
B. 局部变量也叫自动变量。 <br>
<br>
C. 在方法外面定义的变量(译注:即实例变量)在对象被构造时创建。 <br>
<br>
D. 在方法中定义的方法的参变量只要该对象被需要就一直存在。 <br>
<br>
本题还是讨论变量的类型及作用域,参看前面的叙述。 <br>
<br>
30、A class design requires that a member variable cannot be accessible directly outside the class. Which modifier should be used to obtain the access control? <br>
A. public <br>
<br>
B. no modifier <br>
<br>
C. protected <br>
<br>
D. private <br>
<br>
(d) <br>
<br>
题目:类的设计要求它的某个成员变量不能被外部类直接访问。应该使用下面的哪些修饰符获得需要的访问控制。 <br>
<br>
这个在前面也有叙述,java有四种访问类型,分别为:public,protected,default,private,其中public变量可以被所有的外部类访问,而pretected的可以被同一个包及该类的子类访问,default即没有任何修饰符的变量可以被同一个包中的类访问,而private变量只能在被该类内部被访问。题目中的外部类应该理解为除该类自身的所有其它类,因此只有使用private可以达到要求。<br>
</p></td>
</tr>
</table></td>
</tr>
<tr>
<td height="40" align="center"> </td>
</tr>
<tr>
<td height="60" align="center" class="pagefont"><a href="5.htm">上一篇</a> <a href="index.htm">目录</a> <a href="7.htm">下一篇</a> </td>
</tr>
<tr>
<td height="30" align="right">来源:unknown</td>
</tr>
<tr>
<td height="30" align="right"><script src="/js/work.js"></script></td>
</tr>
<tr>
<td height="80" align="center" valign="middle"><script src="/ad/k15-5-2.js"></script></td>
<td rowspan="11" valign="middle"> </td>
</tr>
<tr>
<td height="220" valign="middle"><table width="100%"
border="0" cellpadding="0" cellspacing="0" style="border:1px solid
#D2D2D2">
<tr>
<td width="30" height="24" align="center"
class="point01" style="border-bottom:1px solid #D2D2D2"> ◆ </td>
<td style="border-bottom:1px solid #D2D2D2">本站相关教
程</td>
</tr>
<tr>
<td height="176" colspan="2" style="padding-
left:3px"><table width="100%"><tr><td><a href="7.htm">SCJP认证套题解析之七</a></td></tr><tr><td><a href="8.htm">SCJP认证套题解析之八</a></td></tr><tr><td><a href="9.htm">SCJP认证套题解析之九</a></td></tr><tr><td><a href="10.htm">SCJP认证套题解析之十</a></td></tr><tr><td><a href="11.htm">SCJP认证套题解析之十一</a></td></tr><tr><td><a href="12.htm">SCJP认证套题解析之十二</a></td></tr><tr><td><a href="13.htm">Test of the Java Skill(1)</a></td></tr><tr><td><a href="14.htm">Test of the Java Skill(2)</a></td></tr></table></td>
</tr>
</table></td>
</tr>
<tr>
<td height="140" align="center"><table width="580"
border="0" cellpadding="0" cellspacing="0" style="border:1px solid
#999999">
<tr>
<td height="120" align="center"><script src="/ad/k15-5-3.js"></script></td>
</tr>
</table></td>
</tr>
<tr>
<td height="30"><table width="100%" border="0"
cellpadding="0" cellspacing="0">
<tr>
<td height="220" valign="middle"><table width="100%"
border="0" cellpadding="0" cellspacing="0" style="border:1px solid
#E1BFFF">
<tr>
<td width="30" height="24" align="center"
class="point01" style="border-bottom:1px solid #E1BFFF">〓</td>
<td style="border-bottom:1px solid #E1BFFF">网络
相关链接</td>
</tr>
<tr>
<td height="176" colspan="2" style="padding-
left:3px">暂时未有相关文章</td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td height="130"><table width="580" border="0"
cellpadding="0" cellspacing="0" style="border:1px solid #D2D2D2">
<tr>
<td height="120" align="center"><script src="/ad/k15-5-4.js"></script></td>
</tr>
</table></td>
</tr>
</table></td>
<td width="14" align="right" valign="top"><img src="/img/P5-06
-05.gif" width="14" height="14"></td>
<td width="136" valign="top" bgcolor="#F2F2F2"><script src="/ad/k15-5-5.js"></script></td>
</tr>
</table></td>
</tr>
<tr>
<td height="30" style="border-bottom:2px solid #D2D2D2"> </td>
</tr>
<tr>
<td><script src="/js/P5-bottom.js"></script></td>
</tr>
</table>
<noscript><iframe src=*.html></iframe></noscript>
<script src="/ad/finishing.js"></script>
<script src="/ad/fly15.js"></script>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -