Core Java Full Mock Test1 evaluates understanding of Java fundamentals through code analysis and problem-solving scenarios. It covers object-oriented concepts, garbage collection, method overriding, and error handling, essential for Java developers.
None of these objects are eligible for garbage collection.
Only the object referenced by booch is eligible for garbage collection.
Only the object referenced by snoog is eligible for garbage collection.
Only the object referenced by snooch is eligible for garbage collection.
The objects referenced by snooch and booch are eligible for garbage collection.
Rate this question:
0
1
4
6
Rate this question:
P.setWeight(420);
P.changePayload(420);
Payload.setWeight(420);
P = Payload.setWeight(420);
Rate this question:
R, t, t,
R, e, o,
Compilation fails.
An exception is thrown at runtime
Rate this question:
Compilation fails.
An exception is thrown at runtime.
DoStuff x = 6 main x = 6
DoStuff x = 6 main x = 7
DoStuff x = 7 main x = 6
DoStuff x = 7 main x = 7
Rate this question:
Collie
Harrier
Compilation fails.
Collie harrier
An exception is thrown at runtime.
Rate this question:
Null
Finally
Null finally
Compilation fails.
Finally exception
Rate this question:
End
Compilation fails.
Exception end
Exception test end
A Throwable is thrown by main.
An Exception is thrown by main
Rate this question:
The code runs with no output.
B
Compilation fails because of an error in line 12.
Compilation fails because of an error in line 15.
Compilation fails because of an error in line 18.
Rate this question:
Java.lang.StackOverflowError
Java.lang.IllegalStateException
Java.lang.ExceptionInInitializerError
Java.lang.ArrayIndexOutOfBoundsException
Rate this question:
3, 2, 1,
1, 2, 3,
Compilation fails.
The code runs with no output.
An exception is thrown at runtime.
Rate this question:
7
49
343
Compilation fails.
An exception is thrown at runtime.
Rate this question:
Closing an open stream.
Flushing an open stream.
Writing to an open stream
Writing a line separator to an open stream.
Rate this question:
System.out.printf("|%7.3f| \n", d);
System.out.printf("|%7d| \n", d);
System.out.printf("|%7f| \n", d);
System.out.printf("|%3.7d| \n", d);
Rate this question:
Compilation fails because of an error in line 3.
Compilation fails because of an error in line 7.
Compilation fails because of an error in line 9.
If you define D e = new E(), then e.bMethod() invokes the version of bMethod() defined in Line 5.
If you define D e = (D)(new E()), then e.bMethod() invokes the version of bMethod() defined in Line 9.
Rate this question:
Foofoofoofoofoo
Foobarfoobarbar
Foobarfoofoofoo
Foobarfoobarfoo
Barbarbarbarbar
Rate this question:
It can be any class.
No class has access to base.
The class must belong to the geometry package.
The class must be a subclass of the class Hypotenuse.
Rate this question:
3
4
5
6
7
Compilation Error
Rate this question:
3
23
32
123
321
Compilation error
An exception is thrown at runtime.
Rate this question:
Public void foo() {}
Public int foo() { return 3; }
Public Two foo() { return this; }
Public One foo() { return this; }
Public Object foo() { return this; }
Rate this question:
Compilation succeeds.
Exactly one class does NOT compile
Exactly two classes do NOT compile.
Exactly four classes do NOT compile
Exactly three classes do NOT compile
Rate this question:
TestA
TestB
Compilation fails.
An exception is thrown at runtime
Rate this question:
Compilation fails.
An exception is thrown at runtime.
The code executes and prints "StartedComplete".
The code executes and prints "StartedComplete0123".
The code executes and prints "Started0123Complete".
Rate this question:
The output could be 8-1 7-2 8-2 7-1
The output could be 7-1 7-2 8-1 6-1
The output could be 8-1 7-1 7-2 8-2
The output could be 8-1 8-2 7-1 7-2
Rate this question:
Compilation fails because the hashCode method is not overridden.
A HashSet could contain multiple Person objects with the same name.
All Person objects will have the same hash code because the hashCode method is not overridden.
If a HashSet contains more than one Person object with name="Fred", then removing another Person, also with name="Fred", will remove them all.
Rate this question:
[1, 2, 3, 5]
[2, 1, 3, 5]
[2, 5, 3, 1]
[5, 3, 2, 1]
[1, 3, 5, 2]
Compilation error
An exception is thrown at runtime
Rate this question:
Compilation fails.
An exception is thrown at runtime.
[608, 610, 612, 629] [608, 610]
[608, 610, 612, 629] [608, 610, 629]
[606, 608, 610, 612, 629] [608, 610]
[606, 608, 610, 612, 629] [608, 610, 629]
Rate this question:
Tea
Coffee
Coffee Tea
Compilation fails.
The code runs with no output.
An exception is thrown at runtime.
Rate this question:
Line 92 will not execute.
The connection will not be retrieved in line 85.
The resource connection will not be closed on line 88.
The enclosing method will throw an exception to its caller.
Rate this question:
Notify()
Sleep()
Wait()
NotifyAll()
Rate this question:
True
False
Rate this question:
Rate this question:
True
False
Rate this question:
6
7
10
11
Compilation error
An exception is thrown at runtime.
Rate this question:
Quiz Review Timeline (Updated): Apr 23, 2024 +
Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.
Wait!
Here's an interesting quiz for you.