Java Mock Tests For SCJP
Java Mock Tests For SCJP
4)
JavaBeat Home SCJP 1.4 Home Objectives Forums Mock Exams Online Mock Exam Resources
Mock Exams
MockQuestions - 1 MockQuestions - 2 MockQuestions - 3 MockQuestions - 4
MockQuestions - 5 MockQuestions - 6 MockQuestions - 7 MockQuestions - 8
MockQuestions - 9 MockQuestions - 10 MockQuestions - 11 MockQuestions - 12
MockQuestions - 13 MockQuestions - 14 MockQuestions - 15 MockQuestions - 16
MockQuestions - 17 MockQuestions - 18 MockQuestions - 19 MockQuestions - 20
13. Please select operators which perform bit shifts of the binary representation of
the integral types
A. <<
B. >>
C. >>>
D. ~
E. &
F. ^
G. |
20. The following types of loop are guaranteed to be executed at least once
A. The do loop
B. The while loop
C. The for loop
D. All of the above
21. The switch() construct is used to make a choice based upon ...
A. A char value
B. An int value
C. A String value
D. None of the above
22. The circumstances that can prevent execution of the code in a finally block are
A. The death of the thread
B. The use of System.exit()
C. It is always guaranteed to be executed.
. float
A. long
B. String
. include
A. ifdef
B. sizeof
C. goto
59. Which of the following statements are NOT true about Java garbage collection
Thread?
. static
A. protected
B. final
C. transient
. reference
A. null
B. int
63. The continue statement causes the current iteration of the loop to be skipped
and the next iteration starts.
. True
A. False
. True
A. False
. True
A. False
66. Invoking a constructor of java.io.File class creates a file on the file system.
. True
A. False
True
A. False
71. A yield method of the Thread class suspends the operation of the current
thread.
True
A. False
size()
B. capacity()
C. get(int index)
java.lang.NullPointerException
A. java.lang.ClassNotFoundException
B. java.lang.ClassCastException
C. java.awt.AWTException
74. Which of the following declarations are valid to throw an exception?
java.lang.String
A. java.lang.StringBuffer
B. java.util.Vector
C. java.lang.Integer
76. Which of the following classes store and retrieve values based on a key?
java.util.Hashtable
A. java.util.Vector
B. java.util.LinkedList
C. java.util.HashMap
77. Which of the following classes can store null value for a key?
java.util.Hashtable
A. java.util.HashMap
B. java.util.Properties
True
A. False
True
A. False
80. java.util.HashMap uses synchronized methods to store and retrieve values.
True
A. False
81. Which of the following collections maintain object references in the order they
were added?
java.util.Vector
A. java.util.Hashtable
B. java.util.HashMap
C. java.util.ArrayList
java.util.Dictionary
A. java.util.Map
B. java.util.HashMap
C. java.util.Hashmap
Answers:
1. B
2. C
3. C
4. B
5. B
6. B
7. C and D
8. C and F
9. A
10. D. Comment: A byte value can represent a range of -128 to +127. Arithmetically
answer is 320, but when you store this result to a byte variable you will get a value 64
since result is out of the range (-128 to +127).
11. C
12. A
13. B and C are correct
14. A, B, and C
15. B and C
16. A and B
17. A and B
18. A and D
19. D
20. A. Comment: + and - operator can take two values
21. A
22. A and B
23. A and B
24. C
25. A and B
26. A
27. A
28. B
29. C
30. D
31. A , C, and D
32. C. Thanks Chris Pereira for your feedback in our discussion area.
33. C
34. A
35. A
36. B
37. B
38. A
39. B, and C.
40. B and C
41. A
42. A
43. D
44. A and B
45. C
46. C
47. D
48. B
49. C
50. C
51. A and C
52. C and D
53. C
54. A
55. B
56. A, B, C, and D
57. D
58. A, B, and C
59. B, C, and D
60. A
61. A and B
62. C
63. A
64. B
65. A
66. B
67. B
68. B
69. B Comment: A newly created thread inherits the priority of the Thread that creates it.
70. A and C
71. A
72. A, B, and C
73. A and C
74. A
75. A and D
76. A and D
77. B
78. A
79. A
80. B
81. A and D
82. B
JavaBeat 2005, India (www.javabeat.net)
Submit a Site - Directory - Submit Articles