Useful Resources: o o o o
Useful Resources: o o o o
Useful Resources: o o o o
Books - Preparatory books are a valuable asset for any IT Certification preparation. Here are
some recommended books for the exam:
o Scjp Sun Certified Programmer for Java 5: Exam (310-055)
by Kathy Sierra (Author)
o SCJP Sun Certified Programmer for Java 5 Study Guide
by Sierra and Bert Bates
o SCJP Sun Certified Programmer for Java 5 Practice Exams
by Katherine Sierra (Author), Bert Bates (Author)
o SCJP Exam for J2SE 5: A Concise and Comprehensive Study Guide for The Sun Certified Java
Programmer Exam
by Paul Sanghera (Author)
o Fast Track to Sun Certified Java Programmer (SCJP) 5.0 Upgrade Exam
by Ka, Iok Tong (Author)
References
o Download the JSR from here.
o Get a quick overview with J2SE 6.0 release notes.
o Read J2SE 5.0 in a nutshell
o Read about the new Language Features
o Test yourself with Tiger Quiz
Tutorials and Articles - There are numerous tutorials freely available on the web. The most
reliable and recommended of these are by Sun. Following is a list of some highly useful
tutorials and articles for the exam:
Web Sites
o http://www.lanw.com/java/javacert/default.htm
o http://www.aniyog.com/java/certification.htm
o http://www.javaranch.com/mock.jsp
o http://www.javaranch.com/maha/_Mock_Exams/_mock_exams.html
o http://www.javaranch.com/mock.html
o http://www.certification.about.com/od/freequestions/
o http://www.michael-thomas.com/tech/java/java_info.htm
o http://www.jchq.net/mockexams/exam2.htm
o http://www.jchq.net/mockexams/exam1.htm
o http://www.levteck.com/
o http://www.akgupta.com/Java/mock_exam.htm
o http://www.javaprepare.com/faq.html
o http://www.jdiscuss.com/
o http://www.java.sun.com/docs/books/jls/second_edition/html/j.title.doc.html
Preparation Kit
o Whizlabs Preparation Kit
A. i=0 j=0
B. i=0 j=1
C. i=0 j=2
D. i=1 j=0
E. i=1 j=1
F. i=1 j=2
G. i=2 j=0
H. i=2 j=1
I. i=2 j=2
3. What gets printed when the following code is compiled and run with the
following command -
java test 2
Select the one correct answer.
if(args.length > 1)
System.out.println(i);
if(args.length > 0)
System.out.println(i - 1);
else
System.out.println(i - 2);
}
}
A. test
B. test -1
C. 0
D. 1
E. 2
4. In Java technology what expression can be used to represent number of
elements in an array named arr ?
5. How would the number 5 be represented in hex using up-to four characters.
6. Which of the following is a Java keyword. Select the four correct answers.
A. extern
B. synchronized
C. volatile
D. friend
E. friendly
F. transient
G. this
H. then
7. Is the following statement true or false. The constructor of a class must not
have a return type.
A. true
B. false
8. What is the number of bytes used by Java primitive long. Select the one correct
answer.
A. The number of bytes is compiler dependent.
B. 2
C. 4
D. 8
E. 64
9. What is returned when the method substring(2, 4) is invoked on the string
"example"? Include the answer in quotes as the result is of type String.
10.Which of the following is correct? Select the two correct answers.
A. The native keyword indicates that the method is implemented in another
language like C/C++.
B. The only statements that can appear before an import statement in a Java
file are comments.
C. The method definitions inside interfaces are public and abstract. They
cannot be private or protected.
D. A class constructor may have public or protected keyword before them,
nothing else.
11.What is the result of evaluating the expression 14 ^ 23. Select the one correct
answer.
A. 25
B. 37
C. 6
D. 31
E. 17
F. 9
G. 24
12.Which of the following are true. Select the one correct answers.
A. && operator is used for short-circuited logical AND.
B. ~ operator is the bit-wise XOR operator.
C. | operator is used to perform bitwise OR and also short-circuited logical
OR.
D. The unsigned right shift operator in Java is >>.
13.Name the access modifier which when used with a method, makes it available
to all the classes in the same package and to all the subclasses of the class.
14.Which of the following is true. Select the two correct answers.
A. A class that is abstract may not be instantiated.
B. The final keyword indicates that the body of a method is to be found
elsewhere. The code is written in non-Java language, typically in C/C++.
C. A static variable indicates there is only one copy of that variable.
D. A method defined as private indicates that it is accessible to all other
classes in the same package.
15.What all gets printed when the following program is compiled and run. Select
the two correct answers.
A. 0
B. 1
C. 2
D. The program does not compile because of statement "i=++i;"
17.What all gets printed when the following gets compiled and run. Select the two
correct answers.
A. 0
B. 1
C. 2
D. 3
E. 4
18.What all gets printed when the following gets compiled and run. Select the two
correct answers.
A. 1
B. 2
C. 3
D. 4
19.What all gets printed when the following gets compiled and run. Select the two
correct answers.
A. 1
B. 2
C. 3
D. 4
20.Which of the following are legal array declarations. Select the three correct
answers.
A. int i[5][];
B. int i[][];
C. int []i[];
D. int i[5][5];
E. int[][] a;
21.What is the range of values that can be specified for an int. Select the one
correct answer.
A. The range of values is compiler dependent.
B. -231 to 231 - 1
C. -231-1 to 231
D. -215 to 215 - 1
E. -215-1 to 215
22.How can you ensure that the memory allocated by an object is freed. Select the
one correct answer.
A. By invoking the free method on the object.
B. By calling system.gc() method.
C. By setting all references to the object to new values (say null).
D. Garbage collection cannot be forced. The programmer cannot force the
JVM to free the memory used by an object.
23.What gets printed when the following code is compiled and run. Select the one
correct answer.
A. 0
B. 1
C. 2
D. -1
24.Which of these is a legal definition of a method named m assuming it throws
IOException, and returns void. Also assume that the method does not take any
arguments. Select the one correct answer.
A. void m() throws IOException{}
B. void m() throw IOException{}
C. void m(void) throws IOException{}
D. m() throws IOException{}
E. void m() {} throws IOException
25.Which of the following are legal identifier names in Java. Select the two correct
answers.
A. %abcd
B. $abcd
C. 1abcd
D. package
E. _a_long_name
26.At what stage in the following method does the object initially referenced by s
becomes available for garbage collection. Select the one correct answer.
int i = 0, j = 1;
System.out.println(i);
}
}
A. 4
B. 5
C. 6
D. 6.1
E. 9
39.Is the following statement true or false. As the toString method is defined in the
Object class, System.out.println can be used to print any object.
A. true
B. false
40.Which of these classes defined in java.io and used for file-handling are abstract.
Select the two correct answers.
A. InputStream
B. PrintStream
C. Reader
D. FileInputStream
E. FileWriter
41.Name the collection interface used to represent collections that maintain unique
elements.
42.What is the result of compiling and running the following program.
str1.concat(str2);
System.out.println(str1);
}
}
A. abc
B. def
C. abcabc
D. abcdef
E. defabc
F. abcdefdef
43.Select the one correct answer. The number of characters in an object of a class
String is given by
A. The member variable called size
B. The member variable called length
C. The method size() returns the number of characters.
D. The method length() returns the number of characters.
44.Select the one correct answer. Which method defined in Integer class can be
used to convert an Integer object to primitive int type.
A. valueOf
B. intValue
C. getInt
D. getInteger
45.Name the return type of method hashCode() defined in Object class, which is
used to get the unique hash value of an Object.
46.Which of the following are correct. Select the one correct answer.
A. An import statement, if defined, must always be the first non-comment
statement of the file.
B. private members are accessible to all classes in the same package.
C. An abstract class can be declared as final.
D. Local variables cannot be declared as static.
47.Name the keyword that makes a variable belong to a class, rather than being
defined for each instance of the class. Select the one correct answer.
A. static
B. final
C. abstract
D. native
E. volatile
F. transient
48.Which of these are core interfaces in the collection framework. Select the one
correct answer.
A. Tree
B. Stack
C. Queue
D. Array
E. LinkedList
F. Map
49.Which of these statements are true. Select the two correct answers.
A. For each try block there must be at least one catch block defined.
B. A try block may be followed by any number of finally blocks.
C. A try block must be followed by at least one finally or catch block.
D. If both catch and finally blocks are defined, catch block must precede the
finally block.
1. b
2. b, c, f
3. d. Note that the program gets one command line argument - 2. args.length will
get set to 1. So the condition if(args.length > 1) will fail, and the second check
if(args.length > 0) will return true.
4. arr.length
5. Any of these is correct - 0x5, 0x05, 0X05, 0X5
6. b, c, f, g
7. a
8. d
9. "am"
10.a, c. Please note that b is not correct. A package statement may appear before
an import statement. A class constructor may be declared private also. Hence d
is incorrect.
11.a
12.a
13.protected
14.a, c
15.b, c
16.c
17.a, d, e
18.d, e
19.a, c
20.b, c
21.b, c, e
22.b
23.d
24.a
25.a
26.b, e . The option c is incorrect because a Java identifier name cannot begin with
a digit.
27.d
28.c
29.c, d
30.a, c
31.b, d
32.b, c
33.c
34.c
35.c
36.b, c
37.f
38.long
39.e
40.a
41.a, c
42.Set
43.a
44.d
45.b
46.int
47.d
48.a
49.f
50.c, d
17.What all gets printed when the following gets compiled and run. Select the three
correct answers.
public class test {
public static void main(String args[]) {
int i=1, j=1;
try {
i++;
j--;
if(i/j > 1)
i++;
}
catch(ArithmeticException e) {
System.out.println(0);
}
catch(ArrayIndexOutOfBoundsException e) {
System.out.println(1);
}
catch(Exception e) {
System.out.println(2);
}
finally {
System.out.println(3);
}
System.out.println(4);
}
}