S5
S-1
T4
15
T4
Smile!..eveningmorning
Smile!..morningevening
Smile!..morning
Smile!..morningeveninggood
Smile!..
No output
123
321
32
3
Equals compares hash value and == compares charactersequence
No difference;they are essentially the same
If equals() is true then == is also true
==compares object's memory address but equals charactersequence
== works on numbers equals() works on characters
Prints: T1T2T2
Prints: T1T2T3
Prints: T1T1T2
Prints: T1T1T1
Prints: T1T1T3
@Retention, @Target
@Deprecated, @Override, @SuppressWarning
@Comment, @Class
@Documented, @Inherited
Prints: 22, 20
Runtime Error: Cannot type cast int to byte
Prints: 22, 22
Compile Time Error: Loss of precision
In an inheritance hierarchy, a subclass can also act as a superclass
Inheritance enables adding new features and functionality toan existing class without modifying the existing class
In an inheritance hierarchy, a superclass can also act as a subclass
Inheritance is a kind of Encapsulation
Inheritance does not allow sharing data and methods amongmultiple classes
Polymorphism
Association
Aggregation
Inheritance
Persistence
'Before start method' and 'After stop method'
Compilation error
'Before start method' only
Runtime exception
LineInputStream and BufferedInputStream
FileReader and BufferedReader
InputStreamReader and FileInputStream
FileInputStream and FilterInputStream
FileInputStream and BufferedInputStream
HashSet
TreeSet
Hashtable
LinkedHashSet
SortedSet
The numeric key is unique
It improves performance
It is a 32 bit numeric digest key
HashCode() value cannot be a zero-value
HashCode() is defined in String class
No explicit data type mapping. Automatically mapped onQuery Call.
JDBCTypes
Types
JDBCSQLTypes
SQLTypes
Compilation fails
Welcome Planet 5
Welcome 5
Welcome Planet
The code runs with no output
Rs.getString(1);
Rs.getString("one");
None of listed options
Rs.getString("first");
Rs.getString(0);
Execute mon.notify(thread1); from synchronized code of anyobject
Execute thread1.notify(); from any code(synchronized or not)of any object
Execute thread1.notify(); from synchronized code of anyobject
Execute notify(thread1); from within synchronized code ofmon
You cannot specify which thread will get notified
New Choco().go();
New Bar().go();
New Choco(). new Bar().go();
(new Bar() {}).go();
Go();
None of the objects eligible
Lock1
Lock2
L1
L2
Fields
Jar files
Classes
Methods
Class files
The finalize() method is guaranteed to run once and onlyonce before the garbage collector deletes an object
Finalize() is called when an object becomes eligible forgarbage collection
An object can be uneligibilize for GC from within finalize()
Calling finalize() method will make the object eligible forGarbage Collection
Finalize() method can be overloaded
UnmodifiableCollection(Collection
Collections.checked
SynchronizedCollection(Collection c);
None of the listed options
ArrayList
List
TreeSet
Set
SortedSet
Any class
Any class that extends Target within the test package
Any class that extends Target outside the test package
Only the Target class
Any class in the test package
Java.io.File
Java.io.Serializable
Java.io.FileFilter
Java.io.Console
Java.io.Externalizable
Line a prints the corresponding classname with Object'shashcode in Hexadecimal
Both Line a and Line b prints "Shatapdhi"
Both Line a and Line b will print the corresponding classnamewith Object's hashcode in Hexa Decimal
Output of Line a and Line b will be different
Output of Line a and Line b will be same
Compilation succeeds and the program prints "5"
Compilation fails because of an error on line 9
Compilation succeeds and the program prints "3"
Compilation fails because of errors on lines 10 and 11
Public void start()
Public void run()
Public void stop()
Public void suspend()
Array of int
Boolean
ResultSet
Array of ResultSet
Int value
No output
10
11
30
New Boolean("true").intValue();
New Double(24.5d).byteValue();
New Integer(1).booleanValue();
New Float(100).intValue();
New Integer(100).intValue();
The method X must be declared as throwingFileNotFoundException
Any method calling X must use try-catch, specifically catchingFileNotFoundException
The method X must be declared as throwing IOException orException
No special precautions need be taken
When the modules are deployed to the server
When the other methods, referred in a method in a moduleis modified
When class members are modified
When a method in a module is completed or modified
When the modules are compiled
Lines 10, 11
No need to comment any line. Will compile and run
Lines 10, 11 and 12
Line 11
A class that have static block, should have the main() methoddefined in it
A class can have more than one static block
Static blocks are executed only once
Static blocks are executed before main() method
A static block can call other methods in a class
No output
Prints: 0
Runtime Error
Compilation Error
Divide by Zero errorError HandledUnexpected exception caught
Program compiles and runs without any output
Divide by Zero errorError Handled
Unexpected exception caught
Error HandledUnexpected exception caught
Prints: B
Throws ClassCastException at runtime
Compilation Error 'Cannot find the symbol'
Prints: A
Delcare the variable tmp as StringBuffer type
Declare the variable tmp as static
Insert the following line at line 6else tmp = "not positive";
Change line 4 as followsString tmp = null;
Remove line 4 and insert it at line 2
Compressing the class into zip files and converting it intoexecutable modules, and then packaging it into a jar file
Adding the folder name or jar filename to the CLASSPATHvariable, where the class files of the library exists
Running the application with the following switchesjava -cp ApplicationClassNamejava -classpath ApplicationClassName
Cannot refer to an external libarary, it should be includedbefore the application is packaged.
Pointing the system's PATH variable to the folder or the jarfilename where the class files of the library exists
Code will compile and execute without any error
Throws IOException at // Line 1
Throws IOException at // Line 2
Throws NotSerializableException at // Line 2
Throws NotSerializableException at // Line 1
Code compiles and on running creates and throws Exceptiontype object
Code compiles but run without any output
Code does not complile
Code compiles and on running it prints "NullPointerExceptionhandled" then creates and throws Exception type object
TreeSet
HashMap
HashSet
ArrayList
TreeMap
An exception is thrown at runtime
Prints: XYZ
Compilation fails
Prints: DEF
Prints: ABC
Quiz Review Timeline (Updated): Jul 30, 2011 +
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.