JSPCN主页 | JSP空间 | 网站制作 | JSP下载 | JSP论坛 | JSP教程 | 关于JSPCN | 联系我们
JSP虚拟主机,jsp空间,java空间,java虚拟空间,详细请点击进入
做最专业的JSP中文网站 当前位置首页--JAVA技术--考试相关  
文章搜索:
关键字 标题
  
JSP中文网内容管理系统(JCMS)
JSP虚拟主机
网络笔记本
网摘,图片,笔记收藏
虚拟服务器

JSPCN文章目录分类
JSP配置[219]JSP基础[136]
中文问题[69]上传问题[27]
JAVABEAN[46]数据库[212]
文件操作[126]图片声音[17]
JSP其他[57]时间相关[16]
JAVAMAIL[72]STRUTS[144]
开发工具[28]教程系列[157]
JSP实例[89]
JAVA基础[421]APPLET[78]
JAVA网络[179]Applica[115]
Servlet[98]XML[163]
J2ME[257]J2EE[374]
考试相关[63]JAVA线程[90]
EJB[261]Swing[26]
Java API[141]声音图片[28]
异常处理[33]JAVA实例[290]
JAVA类[139]SUN[89]
Hibernate[6]JMX[8]
Spring[34]
本版推荐文章 
本版热点文章 
相关文章链接 
 
SCJP考试题310-025(第一套)
作者:     文章来源:
访问次数:242次     加入时间:2006年09月06日
这是SCJP的考试原题,是1999-2000期间的!提供给想考SCJP的参考!
我这还有其他的一些,如果全部打印可能100多页(双面)的样子!我将陆续的在这里粘贴出来!(如果可以的话),一共分为几套!这第一套只有19题,其他的几套有点多,300多题的都有,我归纳的,我同事说看完了它,考试就没问题,所以我就搜集了这么多,我也看的头大,所以发出来给大伙分享,敬请关注!!
1. Which statement are characteristics of the >> and >>> operators.
A. >> performs a shift
B. >> performs a rotate
C. >> performs a signed and >>> performs an unsigned shift
D. >> performs an unsigned and >>> performs a signed shift
E. >> should be used on integrals and >>> should be used on floating
point types
C.
2. Given the following declaration
String s = "Example";
Which are legal code?
A. s >>> = 3;
B. s[3] = "x";
C. int i = s.length();
D. String t = "For " + s;
E. s = s + 10;
CDE.
3. Given the following declaration
String s = "hello";
Which are legal code?
A. s >> = 2;
B. char c = s[3];
C. s += "there";
D. int i = s.length();
E. s = s + 3;
CDE.
4. Which statements are true about listeners?
A. The return value from a listener is of boolean type.
B. Most components allow multiple listeners to be added.
C. A copy of the original event is passed into a listener method.
D. If multiple listeners are added to a single component, they all must
all be friends to each other.
E. If the multiple listeners are added to a single component, the order
[in which listeners are called is guaranteed].
BC.
5. What might cause the current thread to stop executing.
A. An InterruptedException is thrown.
B. The thread executes a wait() call.
C. The thread constructs a new Thread.
D. A thread of higher priority becomes ready.
E. The thread executes a waitforID() call on a MediaTracker.
ABDE.
6. Given the following incomplete method.
1. public void method(){
2.
3. if (someTestFails()){
4.
5. }
6.
7.}
You want to make this method throw an IOException if, and only if, the
method someTestFails() returns a value of true.
Which changes achieve this?
A. Add at line 2: IOException e;
B. Add at line 4: throw e;
C. Add at line 4: throw new IOException();
D. Add at line 6: throw new IOException();
E. Modify the method declaration to indicate that an object of [type]
Exception might be thrown.
CE.
7. Which modifier should be applied to a method for the lock of the
object this to be obtained prior to executing any of the method body?
A. final
B. static
C. abstract
D. protected
E. synchronized
E.
8. Which are keywords in Java?
A. NULL
B. true
C. sizeof
D. implements
E. instanceof
DE.
9. Consider the following code:
Integer s = new Integer(9);
Integer t = new Integer(9);
Long u = new Long(9);
Which test would return true?
A. (s==u)
B. (s==t)
C. (s.equals(t))
D. (s.equals(9))
E. (s.equals(new Integer(9))
CE.
10. Why would a responsible Java programmer want to use a nested class?
A. To keep the code for a very specialized class in close association
with the class it works with.
B. To support a new user interface that generates custom events.
C. To impress the boss with his/her knowledge of Java by using nested
classes all over the place.
AB.
11. You have the following code. Which numbers will cause "Test2" to be
printed?
switch(x){
case 1:
System.out.println("Test1");
case 2:
case 3:
System.out.println("Test2");
break;
}
System.out.println("Test3");
}
A. 0
B. 1
C. 2
D. 3
E. 4
BCD.
12. Which statement declares a variable a which is suitable for
referring to an array of 50 string objects?
A. char a[][];
B. String a[];
C. String []a;
D. Object a[50];
E. String a[50];
F. Object a[];
BCF.
13. What should you use to position a Button within an application
frame so that the width of the Button is affected by the Frame size but
the height is not affected.
A. FlowLayout
B. GridLayout
C. Center area of a BorderLayout
D. East or West of a BorderLayout
E. North or South of a BorderLayout
E.
14. What might cause the current thread to stop executing?
A. An InterruptedException is thrown
B. The thread executes a sleep() call
C. The thread constructs a new Thread
D. A thread of higher priority becomes ready (runnable)
E. The thread executes a read() call on an InputStream
ABDE.
Non-runnable states:
* Suspended: caused by suspend(), waits for resume()
* Sleeping: caused by sleep(), waits for timeout
* Blocked: caused by various I/O calls or by failing to get a monitor's
lock, waits for I/O or for the monitor's lock
* Waiting: caused by wait(), waits for notify() or notifyAll()
* Dead: Caused by stop() or returning from run(), no way out
15. Consider the following code:
String s = null;
Which code fragments cause an object of type NullPointerException to be
thrown?
A. if((s!=null) & (s.length()>0))
B. if((s!=null) &&(s.length()>0))
C. if((s==null) | (s.length()==0))
D. if((s==null) || (s.length()==0))
AC.
16. Given the following method body:
{
if (sometest()) {
unsafe();
}
else {
safe();
}
}
The method "unsafe" might throw an IOException (which is not a subclass
of RunTimeException). Which correctly completes the method of
declaration when added at line one?
A. public void methodName() throws Exception
B. public void methodname()
C. public void methodName() throw IOException
D. public void methodName() throws IOException
E. public IOException methodName()
AD.
17. What would be the result of attempting to compile and run the
following piece of code?
public class Test {
static int x;
public static void main(String args[]){
System.out.println("Value is " + x);
}
}
A. The output "Value is 0" is printed.
B. An object of type NullPointerException is thrown.
C. An "illegal array declaration syntax" compiler error occurs.
D. A "possible reference before assignment" compiler error occurs.
E. An object of type ArrayIndexOutOfBoundsException is thrown.
A.
18. What would be the result of attempting to compile and run the
following piece of code?
public class Test {
public int x;
public static void main(String args[]){
System.out.println("Value is " + x);
}
}
A. The output "Value is 0" is printed.
B. Non-static variable x cannot be referenced from a static context..
C. An "illegal array declaration syntax" compiler error occurs.
D. A "possible reference before assignment" compiler error occurs.
E. An object of type ArrayIndexOutOfBoundsException is thrown.
B.
19. What would be the result of attempting to compile and run the
following piece of code?
public class Test {
public static void main(String args[]){
int x;
System.out.println("Value is " + x);
}
}
A. The output "Value is 0" is printed.
B. An object of type NullPointerException is thrown.
C. An "illegal array declaration syntax" compiler error occurs.
D. A "possible reference before assignment" compiler error occurs.
E. An object of type ArrayIndexOutOfBoundsException is thrown.
D.
JSP虚拟主机 | JSP空间 | JSP主机 | JSP双线虚拟主机 | JAVA空间 | JAVA虚拟主机 | 虚拟服务器 | JSP 虚拟服务器 | VPS
Virtual Private Server | JAVA虚拟服务器 | VM服务器 | VHOST | 虚拟操作系统 | JSP论坛 | JAVA论坛 | JSP站点论坛
Copyright © 2002-2005 JSPCN.net. All rights reserved.
JSP中文网    备案序号:蜀ICP备05001583号
成都恒海科技发展有限公司    成都市一环路南二段6号新瑞楼三楼8号