OCPJP 6 Mock Exam -14

ocpjp-6-thumbnail

1 . Given Answer class behaves like some a File it has a Vector, a color, some boolean variable.What is the correct declaration? import public private Vector Serializable File Color extends boolean implements 2 . Some design issues: The following description applies to a class: given someclassname behaves as somesuperclassname and it has some fields […]

OCPJP 6 Mock Exam -13

ocpjp-6-thumbnail

1.What will be the output? Choose the one below: True False 2 . What will be the output? Choose the one below: True False 3 . What will be the output? Is the line marked “lots of code” ever reached? Yes No 4 . What will be the output? Choose the one below: The code […]

OCPJP 6 Mock Exam -12

ocpjp-6-thumbnail

1 . What will be the output? Choose the one below: the code will compile an print “Equal”. the code will compile an print “Not Equal”. the code will cause a compiler error. 2 . What will be the output? Choose the one below: the code will compile an print “Equal”. the code will compile […]

OCPJP 6 Mock Exam -11

ocpjp-6-thumbnail

1 . Consider following classes: What will be the output of running class Test? false false true false true false true true false true true true true true true true true true false true None of the above 2 . Any class may be unloaded when none of it’s instances and class objects that represent […]

OCPJP 6 Mock Exam -10

ocpjp-6-thumbnail

1 . Given: What is the result? Compilation succeeds Compilation fails because of an error on line 1 Compilation fails because of an error on line 3 Compilation fails because of an error on line 7 2 . Given: The ClassA class can be compiled successfully by inserting one of three possible¬†options on line 3. […]

OCPJP 6 Mock Exam – 9

ocpjp-6-thumbnail

1 . What is the result when you compile and run the following code? Choose the one below: Compile Time error Runtime error Prints Testing myTop method in Top class on the console Prints Testing myTop method in Down class on the screen 2 . Which of the code fragments will throw an “ArrayOutOfBoundsException” ? […]

OCPJP 6 Mock Exam – 7

ocpjp-6-thumbnail

1 . Consider the following line of code: What will be happen if you compile and run above code? It will not compile It will not run It will compile but will not run It will output “Hi” 2 . After execution of the code fragment below, what are the value of the variables x1, […]

OCPJP 6 Mock Exam – 6

ocpjp-6-thumbnail

1 . Please select signed integrals char, byte, and short byte, short, int, and long char, short, and long 2 . Java characters are … ASCII code Binary code Unicode ANSI code 3 . Please select the size of an int type 32 bytes 16 bits 32 bits 16 bytes 4 . Select default value […]

OCPJP 6 Mock Exam – 5

ocpjp-6-thumbnail

Q 1 : Which of the following are the correct form of documentation comments? //some text here /*some text here*/ /**some text here*/ all the above Q 2 : State the correct formula for minimum/maximum values for integer primitives where no_of_bits is the size of the type in bits. 2^(no_of_bits-1) / 2^(no_of_bits-1)+1 2^(no_of_bits+1) / 2^(no_of_bits+1)+1 […]

OCPJP 6 Mock Exam – 4

ocpjp-6-thumbnail

Q 1 : What will be the output? Choose the one below: String Object null Compiler Error Q 2 : What will be the output? Choose the one below: String Object null Compiler Error Q 3 : What will be the output? Choose the one below: String Object Test Compiler Error Q 4 : What […]