`
yuanyao
  • 浏览: 147152 次
  • 性别: Icon_minigender_1
  • 来自: 就那小山沟
社区版块
存档分类
最新评论

SCJP认证试题(五)

    博客分类:
  • Java
阅读更多
 /**
 *
 * @author yaoyuan
 */

public class CertKiller{
	int x = 12;
	
	public void method(int x){
		x += x;
		System.out.println(x);
	}
}

Given the exhibit:
21	test t= new CertKiller();
22	t.method(5);


/**
*What is the ouput from line 5 of the CertKiller class?
*
*
*A 5
*B 10
*C 12
*D 17
*E 24
*/

//Answer B

 /**
 *
 * @author yaoyuan
 */

10	class CertKiller1{
11		public CertKiller1 Foo(){ return this;}
12	}
13	class CertKiller2 extends CertKiller1{
14		public CertKiller1 Foo(){return this;}
15	}
16	class CertKiller3 extends CertKiller2{
17		//insert code here
18	}

/**

*Which two methods, inserted individually , correctlly complete the CertKiller3 class?(choose two)
*
*
*A public void foo(){}
*B public int foo(){return 3;}
*C public CertKiller2 foo(){return this;}
*D public CertKiller1 foo(){return this;}
*/


//Answer: C D

 /**
 *
 * @author yaoyuan
 */

11	public class Bootchy{
12		int bootch;
13		String snootch;
14	
15		public Bootchy(){
16			this("snootchy");
17			System.out.print("First " );
18		}
19
20		public Bootchy(String snootch){
21			this(420, "snootchy");
22			System.out.print("Second ");
23		}
24		
25		public Bootchy(int bootch, String snoothy){
26			this.bootch = bootch;
27			this.snootch = snootch;
28			System.out.print("Third ");
29		}
30
31		public static void main(String[] args){
32			Bootchy b = new Bootchy();
33			System.out.print(b.snootch + " " + b.bootch);
34		}
35	}

/**
*What is the result?
*
*
*A snootchy 420 Third Second First
*B snootchy 420 First Second Third
*C First Second Third snootchy 420
*D Third Second First snootchy 420
*E Third First Second snootchy 420
*F First Second First Third snootchy 420
*/

//Answer D


 /**
 *
 * @author yaoyuan
 */

11	public static void main(String[] args){
12		Object obj = new int[]{1,2,3};
13		int[] someArray = (int[])obj;
14		for(int I : someArray)  System.out.print(I + " ");
15	}


/**
*What is the result?
*
*A 1 2 3
*B Compilition fails because of an error in line 12
*C Compilition fails because of an error in line 13
*D Compilition fails because of an error in line 14
*E A ClassCaseException is thrown at runtime
*/

//Answer : A


/**
*
* @author yaoyuan
*/

/**
*A Java Bean component has the following field:
*11.PRIVATE BOOLEAN ENABLED;
*Which two pairs of method declarations follow the javabean standard for accessing this field?(choose two)
*
*
*A public void setEnabled(Boolean enabled)
* public Boolean getEnabled()
*B public void setEnabled(Boolean enabled)
* public void isEnabled()
*C public void setEnabled(Boolean enabled)
* public Boolean isEnable()
*D public void setEnabled(Boolean enabled)
* public Boolean getEnabled()
*/


//Answer: A C



/**
*
* @author yaoyuan
*/

10	class CertKiller{
11		static void alpha(){/*more code here*/}
12		void beta(){/*more code here*/}
13	}


/**
*Which two statements are true?
*
*
*A CertKiller.beta() is valid invocation of beta()
*B CertKiller.alpha() is valid invocation of alpha()
*C Method beta() can directly call method alpha()
*D Method alpha() can directly call method beta()
*/

//Anwser : B C



 /**
 *
 * @author yaoyuan
 */

public abstract class Shape{
	private int x;
	private int y;
	
	public abstract void draw();

	public void setAnchor(int x, int y){
		this.x = x;
		this.y = y;
	}
}


/**
*Which two classes use the Shape class correctly?(choose two)
*
*A public class Circle implements Shape{
* private int radius;
* }
*B public abstract class Circle extends Shape{
* private int radius;
* }
*C public class Circle extends Shape{
* private int radius;
* public void draw();
* }
*D public abstract class Circle implements Shape{
* private int radius;
* public void draw();
* }
*E public class Circle extends Shape{
* private int radius;
* public void draw(){/*code here*/}
* }
*F public abstract class Circle implements Shape{
* private int radius;
* public void draw(){/*code here*/}
* }
*/


//Answer: B E



 /**
 *
 * @author yaoyuan
 */
11	static class A {
12		void process() throws Exception{throw new Exception();}
13	}

14	static class B extends A{
15		void process(){System.out.println("B");}
16	}
17	public static void main(String[] args){
18		A a = new A();
19		A.process();
20	}

/**
*What is result
*
*
*
*A B
*B The code exception is thrown at runtime
*C The code run with no output
*D Compilition fails because of an error in line 15
*E Compilition fails because of an error in line 18
*F Compilition fails because of an error in line 19
*
*/


//Answer : F



 /**
 *
 * @author yaoyuan
 */
33	try{
34		//some code here
35	}catch(NullPointerException e1){
36		System.out.print("a");
37	}catch(RuntimeException e2){
38		System.out.print("b");
39	}finally{
40		System.out.print("c");
41	}

/**
*What is the result if NullPointerException occurs on line 34?
*
*A c
*B a
*C ab
*D ac
*E bc
*F abc
*/


//Answer : D



 /**
 *
 * @author yaoyuan
 */

10	public class CertKiller{
11		static int[] a;
12		static {a[0] = 2;}
13		public static void main(String[] args){}
14	}


/**
*Which exception or error will be thrown when a programmer attempts to run this code?
*
*A java.lang.StackOverflowError
*B java.lang.IllegalStateException
*C java.lang.Exceptio0nInInitoatializerError
*D java.lang.ArrayIndexOutOfBoundsException
*
*/


//Answer : C
分享到:
评论
6 楼 iranger 2008-12-18  
倒数第六题,选项A和选项D有啥区别?恕我眼拙,没看出来
5 楼 ironsabre 2008-11-20  
cats_tiger 写道
KAO,运行一遍不就都知道了?这种考试好无聊。


SCJP还可以的,大多数通过SCJP的人java基本功都还不错。
4 楼 yuanyao 2008-11-20  
这位大哥,你刚学java的时候,敢这么嚣张吗??还运行,佩服,佩服.....
3 楼 cats_tiger 2008-11-20  
KAO,运行一遍不就都知道了?这种考试好无聊。
2 楼 yuanyao 2008-11-20  
谢谢iranger的支持,最近时间特紧,什么都赶到一起去了,SCJP的题目也赶时间,写的匆忙,有很多问题,请见谅啊.....
1 楼 iranger 2008-11-18  
倒数第三道题目,哪里有line19?
倒数第四题答案B一看就是错的,你实现了一个抽象类??
不过还是谢谢楼主放出SCJP题目,最近正想考个玩儿玩

相关推荐

    scjp认证试题.rar

    这个压缩包文件包含了多个与SCJP认证相关的学习资源,包括试题、题库和答案,以及一些重要的复习资料。 1. **SCJP认证概述**:SCJP是Java初学者或初级开发者提升职业资质的重要途径。通过这个认证,开发者可以证明...

    java认证试题 scjp模拟试题

    Java认证,全称为Sun Certified Programmer for the Java 2 Platform, Standard Edition ...以上这些知识点都是SCJP认证考试的重点,通过深入学习和大量练习,考生可以提升自己的Java编程技能,提高通过考试的可能性。

    SCJP试题SCJP试题SCJP试题

    关于SCJP(SUN Certified Programmer for the Java SE Platform)试题,这是Java编程语言的一个认证考试,旨在测试应试者对Java基础知识的理解和应用能力。以下是一些相关知识点的详细解释: 1. **方法(Method)**...

    JAVA认证-scjp模拟试题

    本压缩包文件提供了三个部分的"JAVA SCJP认证模拟试题",分别是"SCJP模拟试题(一).doc"、"SCJP模拟试题(二).doc"和"SCJP模拟试题(三).doc",这些文档可能包含了多个章节的练习题目,覆盖了Java语言的核心概念...

    scjp 认证 试题

    SCJP认证试题通常涵盖以下几个主要领域: 1. **Java语言基础**:包括基本语法、数据类型、变量、运算符、流程控制(如if-else、switch、for、while循环)、方法、数组等。这些是Java编程的基础,理解和熟练掌握它们...

    SCJP认证学习资料

    SCJP认证的学习资料通常会包含详细的理论讲解、实例演示、习题解答和模拟试题,帮助学习者全面掌握这些知识点。通过阅读这5本书,你将有机会深入理解Java语言的各个方面,为SCJP认证考试做好充分准备。同时,不断...

    java scjp模拟试题

    这份"java scjp模拟试题"包含三套模拟测试题,是准备SCJP认证考试的宝贵资源。通过这些试题,考生可以检验自己的知识掌握程度,熟悉考试的格式和题型,提高备考效率。 模拟试题通常涵盖以下几个关键知识点: 1. **...

    SCJP试题,SCJP试题

    SCJP,全称为Sun Certified Programmer for the Java 2 Platform,是Oracle公司(原Sun Microsystems)推出的针对Java程序员的认证考试。这个考试旨在测试考生对于Java SE平台基础编程的知识和技能。以下是一些SCJP...

    SCJP认证试题

    根据给定的文件信息,以下是对“SCJP认证试题”中的关键知识点的详细解析: ### SCJP认证概览 SCJP(Sun Certified Programmer for Java Platform)是Java领域中最具权威的专业程序员认证之一,由Sun Microsystems...

    scjp试题 java 认证 考证

    Java SCJP(SUN Certified Programmer for the Java Platform)是针对Java初学者的一项认证考试,它主要测试考生对Java基础知识的理解和应用能力。...熟悉并掌握这些知识点对于通过SCJP认证考试至关重要。

    JAVA国际认证(SCJP)典型试题1000例

    首先,我们要了解SCJP认证涉及的基础知识: 1. **Java语言基础**:包括数据类型(如整型、浮点型、字符型、布尔型)、变量声明、运算符(算术、关系、逻辑、位、赋值等)、流程控制(if-else、switch、循环、跳转...

    SCJP认证套题解析

    "SCJP认证套题解析"是一个针对这项认证的备考资源,通常包括一系列模拟试题、答案解析以及相关的知识点讲解。 SCJP认证覆盖的知识点广泛,主要包括以下几个方面: 1. **Java语言基础**:这部分内容涉及Java语法、...

    JAVA认证 scjp模拟试题.rar

    总的来说,准备SCJP认证需要系统学习Java语言的核心概念,并通过大量的实践和模拟试题来提高编程能力和应对考试的能力。这个压缩包文件很可能是备考SCJP的一个重要资源,考生应当充分利用其中的资源进行复习和准备。

    Java scjp考试试题

    ### Java SCJP考试知识点解析 #### 题目87: 命令行参数解析与输出 **题目描述:** 在给定的代码中,`Test` 类包含了一个 `main` 方法,该方法试图从命令行参数数组 `args` 中获取元素并将其赋值给 `String` 类型的...

    JAVA认证历年真题 SCJP认证套题解析

    【JAVA认证历年真题 SCJP认证套题解析】主要涵盖了JAVA语言的基础知识,包括数据类型、标识符规则、数值类型转换、字符串操作以及对象和类的使用等方面。以下是这些知识点的详细说明: 1. **数据类型**:题目中提到...

    scjp模拟试题大全

    SCJP(Sun Certified Programmer for the Java 2 Platform, Standard Edition)是Oracle公司为Java程序员提供的一项认证考试,旨在验证考生对Java编程语言的基础知识和理解。这个认证在Java社区中非常受到重视,因为...

    《Java国际认证(SCJP)典型试题1000例 中文版

    首先,SCJP认证是Java程序员入门阶段的重要凭证,它证明了持有者具备编写和调试Java程序的基本技能。这个认证涵盖了语言特性、类库、内存管理以及异常处理等方面的基础知识。 1. **Java语言特性**:书中会涵盖Java...

    scjp模拟试题三套

    SCJP认证考试通常涵盖以下几个核心领域: 1. **Java语法**:包括基本的数据类型、变量、运算符、流程控制(if语句、switch、循环)、方法、类和对象的概念,以及异常处理。理解这些基础知识是编写任何Java程序的...

Global site tag (gtag.js) - Google Analytics