Wednesday, April 17, 2013

Extends KeyWord Questions

1)       class A1 extends Exception{}
       class B1 extends A1{}
       class C1 extends B1{}
       public class Test {
          static void aMethod() throws C1{ throw new C1(); }
          public static void main(String[] args){
          int x = 10;
           try { aMethod(); }
           catch(A1 e) { System.out.println("Error A");}
           catch(B1 e) { System.out.println("Error B");}
          }
       }


A)Error B
B)compilation error
c)Runtime error
d)Error A

 Ans : compilation error
Reason : Unreachable catch block for B. It is already handled by the catch block for A


SCJP SYLLABUS

Section 1: Declarations, Initialization and Scoping

* Develop code that declares classes (including abstract and all forms of nested classes), interfaces, and enums, and includes the appropriate use of package and import statements (including static imports).

* Develop code that declares an interface. Develop code that implements or extends one or more interfaces. Develop code that declares an abstract class. Develop code that extends an abstract class.

* Develop code that declares, initializes, and uses primitives, arrays, enums, and objects as static, instance, and local variables. Also, use legal identifiers for variable names.

* Develop code that declares both static and non-static methods, and - if appropriate - use method names that adhere to the JavaBeans naming standards. Also develop code that declares and uses a variable-length argument list.

* Given a code example, determine if a method is correctly overriding or overloading another method, and identify legal return values (including covariant returns), for the method.

* Given a set of classes and superclasses, develop constructors for one or more of the classes. Given a class declaration, determine if a default constructor will be created, and if so, determine the behavior of that constructor. Given a nested or non-nested class listing, write code to instantiate the class.

Section 2: Flow Control
* Develop code that implements an if or switch statement; and identify legal argument types for these statements.


SCJP IMPORTANT LINK

Sun Certified Programmer for the Java 2 Platform, Standard Edition 5.0 (CX-310-055)

The Sun Certified Programmer for Java 2 Platform 5.0 certification exam is for programmers experienced using the Java programming language.

Exam number :CX-310-055
Available at :Authorized Prometric testing centers
Prerequisites :None
Other exams/assignments required for this certification :None
Exam Type :Multiple choice and Drag and Drop
Cost :150 USD
Number of questions :72
Pass score :59% (43 of 72 questions)
Time Limit :175 minutes (2 hrs and 55 minutes)


Sun Certified Programmer for the Java 2 Platform, Standard Edition 5.0 Upgrade Exam (CX-310-056)

The Sun Certified Programmer for Java 2 Platform 5.0 certification exam is for programmers experienced using the Java programming language.

Exam number :CX-310-056
Available at :Authorized Prometric testing centers
Prerequisites :Successful completion of previous version of Sun Certified Programmer for Java 2 Platform exam
Other exams/assignments required for this certification :None
Exam Type :Multiple choice and Drag and Drop
Cost :100 USD
Number of questions :46
Pass score :58% (27 of 46 questions)
Time Limit :105 minutes (1 hr and 45 minutes)


Sun Certified Programmer for Java 2 Platform 1.4 (CX-310-035)

The Sun Certified Programmer for Java 2 Platform 1.4 certification exam is for programmers experienced in using the basic syntax and structure of the Java programming language.

Exam number :CX-310-035
Available at :Authorized Prometric testing centers
Prerequisites :6-12 months of experience
Other exams/assignments required for this certification :None
Exam Type :Multiple choice and short answer
Cost :150 USD
Number of questions :61
Pass score :52% (32 of 61 questions)
Time Limit :120 minutes (2 hrs)