SCJP Declarations and access control

Java Programming World, Inc.                                  Since 2005
java programming

    The contents of this page are intended for SCJP 1.4 exam (310-035). The Sun Certified Java Programmers Exam (SCJP) is the internationally recognized. This site includes java certification mock exams, practice tests, Frequently Asked Questions (faq), scjp2 study material and sample code created by a Sun Certified Java Programmer which makes java certification exam preparation very easy.

    Earning a sun certification provides a clear demonstration of the core java scjp skills. This page is devoted to Java programmer certification, the exam which is commonly known as SCJP. The page contains links to several excellent resources for sun certification java.

Resources for java certification SCJP exam. There are mock exams and other useful java links.

    For clearing SCJP tests you need to know the basics of core java. There are three variations in SCJP.
 

CX-310-025 for SCJP 1.2

Exam type            -       Multiple choice and short answer
Total Questions  -       59
Pass score           -       61% i.e. 36 of 69 questions must be answered

CX-310-035 for SCJP 1.4

Exam type            -       Multiple choice and short answer
Total Questions  -       61
Pass score           -       52% i.e. 32 of 61 questions must be answered

CX-310-055 for SCJP 1.5 / SCJP 5.0

Exam type            -       Multiple choice and short answer
Total Questions  -       72
Pass score           -       59% i.e. 43 of 72 questions must be answered

    SCJP  5.0  is the latest Entry Level Certification exam provided by SUN Microsystems. SCJP 5.0 is based up on J2SE 5.0. I recommend that u should choose J2SE 1.4 as it has more resources on the web. The fee is around $150. You can buy a Voucher online and take the test at any thompson optometric center (the voucher would be valid for 1 year using which you get 20% discount).

    The recommended scjp books that you need to follow are:

1. A Programmer's Guide to Java Certification
                                                                by Khalid Azim Mughal, Rolf Rasmussen

2. Sun Certified Programmer & Developer for Java 2 Study Guide (Exam 310-035 & 310-027)
                                                                Kathy Sierra and Bert Bates
 

Note: Below are some Useful Programming Resources. Please use <right-click> "Save Link as" for pdf and doc Files.

Java Links

Beginner Java Tutorial

JDBC Tutorial

Java Interview Questions

Sun Certification Material (SCJP)

scjp khalid mughal

A Programmer's Guide to Java Certification - by Khalid Mughal and Rolf Rasmussen - very very good ebook for the exam. This one contains detailed description, and explains IO, Threads, GC etc quite well.

Complete Java2 Certification Guide


This site provides all the information you would need to prepare for Suns Certification exam (SCJP2). It provides study material, sample questions for all the topics covered in the exam, a Certification FAQ, a mock exam, and links to many other related sites. 

 

SCJP mock Exam

QUESTION1


    What is the result of attempting to compile and run this
         interface A{
          void aMethod();
          }
          public class Test implements A{
          void aMethod(){
          System.out.println("hello");
          }
          public static void main(String[] args){
          Test t = new Test();
          t.aMethod();
          }  
         } 

1. The code will not compile.
2. Runtime exception.
3. Compiles and runs printing out "hello".

ANS : 1

     All interface methods are implicitly public.
     Will fail compilation becuse the access modifier
     for aMethod() is being made more restrictive.


QUESTION2

     Is this code legal ?
         public class Test {
          void aMethod(){
          static int b = 10;
          System.out.println(b);
          }
         }

  

1. Yes
2. No

ANS : 2
   Local variables cannot be declared static.



QUESTION3
    Is this legal
          public class Test {
            static { int a = 5; }
            public static void main(String[] args){
            System.out.println(a);
            }
          }

1.Yes
2.No

ANS : 2
  Correct ans : 2
  A variable declared  in a static initialiser is not accessible outside its 
  enclosing block.


QUESTION4
     
     Select the true statements.

1. Transient methods cannot be overridden
2. A final class may not be subclassed.
3. A private method can never be overridden to become public
4. An abstract class may contain final methods
5. A private method cannot be overridden and made public
6. Final methods may not be overridden.

ANS : 2,4,5,6
     


QUESTION5


      Which of the following are valid for declaring and intialising
      a char variable?


1. char c    = 'a';
2. char c    = '\'';
3. char c    = '\n';
4. char c    = "a";
5. char c    = \u0061;
6  char c    = 97; 

ANS : 1

   Corr answer : 1,2,3 and  6


QUESTION6
     
     Which of the following are valid for declaring and initialising
     a boolean variable?
     


1. boolean b = True;
2. boolean b = 0;
3. boolean b = 1 < 2;
4. boolean b = true?false:true;
5. boolean b = true;

ANS : 3,4,5
    
  


QUESTION7

 
   
       Select the valid declarations.



1. int i = 16.0;
2. byte b = 16.0;
3. float f = 16.0;
4. double d = 16.0;
5. char \u0063 = '\u0063';

ANS : 4,5 
     16.0 is a double type literal hence it becomes a widening
     assignment for a byte, int  or float.


QUESTION8
    
    What is the result of attempting to compile and run this code
     public class Test{
       int i;
       Test(){
       i++;
       }
       public static void main(String[] args){
       Test t = new Test();
       System.out.println("value = " t.i);
       }
     }


1. The code will compile and run  printing out value = 1
2. The code will compile and run  printing out value = 0
3. The code will fail to compile becuse i has not been initialised
4. Run time error

ANS : 1
   Numeric instance variables are always 
   automatically initialised to its default value.
   So you can use them without explicitly initialising them.


QUESTION9


    Whhat is the result of attempting to compile and run the following
      public class Test{
         int arr[] = new int[8];
         public static void main(String[] args){
          Test t = new Test();
         System.out.println(t.arr[7]);
          }
      }

1. Compiler error
2. Runtime exception
3. Compiles and runs printing out 0

ANS : 3

   Numeric instance variables are always 
   automatically initialised to its default value.
   In the case of arrays each element of the array is 
   initialised to its defaut value.


QUESTION10

  What is the result of trying to compile and run this
          public class Test{
              public static void main(String[] args){
          int a;
                 Test t = new Test();
                 for(int j=0; j < 2 ; j++){
                     for(int i=0; i <4 ; i++){
                      a = j;
                      }
                 System.out.println(i);
                 }
               }
          }


1. Compiles without error and runs printing out 1 twice.
2. Compiles without error and runs printing out 0 followed by 1 .
3. Compiles without error and runs printing out 0 twice.
4. Runtime error
5. Does not compile

ANS : 5

   The variable i is not accessible outside the enclosing block of the
   inner loop.


Get in touch with me personally at  hemanthjava@gmail.com

OTHER SITES OF MINE

FRESHERS JOBS AND PLACEMENT PAPERS

VTU PROJECTS AND PROGRAMS

 

Projects

1. Java Graphics Editor

scjp mock exams

These Mock exams will get you started with some simple practice questions. Its a great way to begin your SCJP 1.4 training.

scjp testking

Mock Exam Engine

1. Marcus Green Mock Exam 1

2. Marcus Green Mock Exam 2

3. Marcus Green Mock Exam 3

4. Java Test

5. Mock

6. Java Quiz 1

7. Java Quiz 2

8. Java Certification Mock Exam

Eclipse Tutorials

1. eclipse1.doc : A Simple tutorial showing how to create a project and execute code.

2. eclipse2.doc :  Frequently used Settings an Eclipse user should take care.

3. eclipse3.rtf :  Eclipse keyboard Shortcuts.

Sun Certifications are well recognized in the developers' community. Perhaps one of the reasons why Sun Certifications are so popular is that the exams are generally viewed as fairly challenging.

SCJP: A Sun Certified Java Programmer uses J2SE technologies to demonstrate the programming competence on Java platform.

Bob's Java Programming World, Inc. is independent of Sun Microsystems. All Rights Reserved