Compilation fails because of an error on line 5
Compilation succeeds and the program prints: 0 1 2 1 2 3 2 3 4 3 4 5 4 5 6 5 6 7
Compilation fails because of an error on line 3
Compilation succeeds and the program prints: 1 1 1 2 2 2 3 3 3 4 4 4 5 5 5 6 6 6
FileOutputStream
LogWriter
PrintWriter
OutputStream
Writer
Compilation Error
Compiles successfully and prints a value which is less than zero
Compiles successfully and prints a value which is equal to Integer.MIN_VALUE
Compiles successfully and prints a value which is equal to - Integer.MAX_VALUE
Compiles successfully and prints a value which is equal to Integer.MIN_VALUE + 1
Line 1 : throw new IOException(); Line 2 : throw new FileNotFoundException(); Line 3 : throw new Exception();
Line 1 : throw new Exception(); Line 2 : throw new IOException(); Line 3 : throw new FileNotFoundException();
The code is wrong. Exceptions should be caught in reversed hierarchy order.
Line 1 : throw new IOException(); Line 2 : throw new IOException(); Line 3 : throw new IOException();
Line 1 : throw new FileNotFoundException(); Line 2 : throw new IOException(); Line 3 : throw new Exception();
ResultSet.TYPE_SCROLL_SENSITIVE
ResultSet.TYPE_SCROLLABLE
ResultSet.TYPE_SCROLL_INSENSITIVE
ResultSet.TYPE_FORWARD_ONLY
ResultSet.TYPE_SCROLL_BIDIRECTIONAL
Reads the text from keyboard character by character and prints the same to the console on typing every character.
Reads the text from keyboard and prints the same to the console on pressing Ctrl Z, flushes (erases) the same from the console.
Reads the text from keyboard line by line and prints the same to the console on pressing ENTER key at the end of every line
Reads the text from keyboard and prints the same to the console on pressing Ctrl Z
Reads the text from keyboard line by line and prints the same to the console on pressing ENTER key at the end of every line, then the same is flushed (erased) from the console.
Execute mon.notify(thread1); from synchronized code of any object
Execute notify(thread1); from within synchronized code of mon
You cannot specify which thread will get notified
Execute thread1.notify(); from synchronized code of any object
Execute thread1.notify(); from any code(synchronized or not) of any object
Association refers to a class reuses the properties and methods of another class
Association refers to an object composed of set of other objects
Association refers to binding of related data and behaviours into a single entity
Associations are bi-directional
In Associations, cardinality refers to the number of related objects
Size: 64
Size: 44
Size: 66
Compilation error
Size: 46
Two
None of the objects are eligible
Three
Four
One
1. setUp() method 2. testXXX() method 3. tearDown() method Above sequence is for every testXXX() method in the TestCase
1. setUp() method 2. tearDown() method 3. All testXXX() methods
1. All testXXX() methods 2. setUp() method 3. tearDown() method
1. setUp() method 2. All testXXX() methods 3. tearDown() method
Input : java TM "Trick1"+"Trick2" "Trick3" Output: Trick1+Trick2132
Input : java TM 'J2SE', 'J2EE', 'J2ME' Output: J2SE43
Input : java TM 123+456 "abc" "Tricky" Output: 57933
Input : java TM 'This is really tricky' Output: This is really tricky211
Input : java TM "123", abc+234 Output: 123,42
The class is fully encapsulated
The ownerName variable breaks encapsulation
The setCardInformation method breaks encapsulation
The cardID and limit variables break polymorphism
The code demonstrates polymorphism
Form feed character
Tab character
The dollar character
Space character
The underscore character
Prints: "Title is null" to standard output.
A NullPointerException is thrown at Runtime
A ClassCastException is thrown at Runtime
Compilation Error
Prints: A.m1, A.m2, A.m3, A.m4,
Compile-time error at 4.
Compile-time error at 3.
Compile-time error at 2.
Compile-time error at 1.
ArrayList[Integer] a = new ArrayList[Integer]();
ArrayList[WrapperType] a = new ArrayList[WrapperType]();
ArrayList[Integer] a = new ArrayList[Double]();
ArrayList[Double] a = new ArrayList[Double]();
ArrayList[Number] a = new ArrayList[Number]();
Type IV driver
Type II driver
Type I driver
Type III driver
Array index can be a negative value
String[][] s;
Array decaration: String[6] strarray;
String[][] s = new String[5][];
Array index can be a long value
Prints: EQ
Prints: equals
Compile-time error: Wrapper types cannot be compared using equals
Prints: equals EQ
Compile-time error: Integer wrapper cannot accept char type
3
No output
321
32
123
Prints: 10, 40
Prints: 20, 40
Compile time Error: Method parameter does not match variable
Prints: 10,20
It prints keepSmiling with a 10000-second delay between keep and Smiling.
It prints keepSmiling with a 10-second delay between keep and Smiling
An exception is thrown at runtime
It prints keep and never exits
It prints keepSmiling and exits almost immeditately
T.join()
t.start()
No additional code required
T.run()
T.sleep(1000)
SortedSet
List
Map
Vector
Class B should be declared public abstract
Class A should be declared public abstract
The print method in class B should refer the x as super.x
The member x in class A should be declared as protected
This() method call should be removed from the class A constructor
SQLException
Driver
Connection
DriverManager
Statement
Compiles successfully, nothing is printed
Compilation Error
Runtime Error
d. Inside showMethod. followed by caught: java.lang.IllegalAccessException: exception
Classes
Fields
Jar files
Class files
Methods
Iii, ii, i, iv
Iii, i, ii, iv
Ii, i, iv, iii
I, iv, iii, ii
Iv, iii, ii, i
10 10
10 20
Compile time error. Incompatible Type conversion.
20 10
20 20
A SortedSet extended with navigation methods for Maps.
A SortedSet extended with navigation methods for Lists.
A new class implementation of Set which can navigate the ResultSet object
A SortedSet extended with navigation methods reporting closest matches for given search targets.
The code runs with no output
Compilation fails
Welcome!
Planet!
An exception is thrown at runtime
Compilation fails because of an error in line 11
A NullPointerException occurs at runtime
Prints: 4
A NumberFormatException occurs at runtime
No compilation error but throws RuntimeException on running the code
Compilation error at line 10
Compilation error at line 14
Compilation error at line 5
Compilation error at line 6
Hello Hello Hello
World Hello Hello
Hello Hello world
Hello world Hello
World world world
Any class in the test package
Any class that extends Target outside the test package
Any class
Only the Target class
Any class that extends Target within the test package
Polymorphism
Inheritance
Abstraction
Reusability
Transforms s1 into the union of s1 and s2
Transforms s1 into the intersection of s1 and s2.
Copies elements from s2 to s1
Returns true if s2 is a subset of s1
Line 4
Line 7
Line 6
Line 3
Line 5
@Override
@Documented
@Comment
@Deprecated
Thread A's wait() times out.
Thread A releases the lock on B by calling the notifyAll()
Thread A is interrupted.
Thread B is interrupted.
Thread B releases the lock on object X and calls the notify() method on thread
Error objects are thrown only by JVM
Errors can be thrown programmatically
A class can extend Error class and can be used as user-defined Error class
Errors are handled only by JVM
Errors cannot be handled programmatically using try-catch blocks.
An object becomes eligible for garbage collection when all references denoting it are set to null
The automatic garbage collection of the JVM prevents programs from ever running out of memory
A program can suggest that garbage collection be performed but not force it
None of the listed options
Garbage collection is platform independent
Defined in the Object class
Essential for inheriting a class
Used for object's content comparison
It is polymorphic
Declared in the Object class
Quiz Review Timeline +
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.