Java Toughest Exam Quiz! Trivia challenges advanced Java programming skills, focusing on nested classes, method overriding, overloading, runtime exceptions, and numeric operations. Ideal for learners seeking to test their Java expertise in a rigorous format.
Both the methods must not be in the same class
Same name same signature
Same name different signature
Both the methods must be in the same class
Rate this question:
Static methods cannot be overloaded
Overloaded methods should always return same type of value
Overloaded methods cannot be declared as abstract
Methods can be overloaded across inherited classes
Rate this question:
True
False
Rate this question:
++
+
-
=
==
Rate this question:
New Boolean(“truth”);
New Long(“3465”);
New Integer(“637”);
New Character(“B”);
New Byte(“10”);
Rate this question:
0
Compile time error
1
Run time error
Rate this question:
Polymorphic
Generic
Composition
Aggregation
Rate this question:
Run time error test() method does not throw an error type instance
Compile time error Cannot catch Error type objects
Compile time error Error class cannot be extended
Prints Error caught
Rate this question:
Compilation error at line no 8
Throws Runtime Exception
Prints the output [Green World, 1, Green Peace] at line no 9
Prints the output [Green World, Green Peace] at line no 9
Rate this question:
An interface can implement another interface
An interface can be instantiated
All the methods of an interface are by default abstract
An interface can contain concrete methods
Rate this question:
For-each loop does the automatic typecasting
For-each loop is an alternative to Enumeration
For-each loop is an alternative to Iterator
For-each loop can work only with generic collections
Rate this question:
True
False
Rate this question:
RuntimeException can be handled using a catch that handles Error
Any class that derives the RuntimeException will always be an unchecked exception
RuntimeException does not require a throws declaration
If RuntimeException is declared using throws clause, then the calling methods should handle it using try –catch block
Rate this question:
Interface A,B,C
Interface B,C,D
Interface B,C
Interface A,B
StringBuffer can be extended, since it is mutable
StringBuffer is a mutable class
StringBuffer is a sub class of String class
StringBuffer is a Wrapper to the existing String class
Rate this question:
Finalize will run when an object becomes unreachable
Finalize allows a programmer to free memory allocated to an object
Finalize may run before or after an object is garbage collected
Finalize will always run before an object is garbage collected
Rate this question:
A catch block can have another try block nested inside
An exception which is not handled by a catch block will be handled by subsequent catch blocks
Finally block cannot have a try block with multiple catch blocks
An exception which is not handled by a catch block can be handled by writing another try catch block inside finally block
Rate this question:
Class and Interfaces in the sub packages will be automatically available to the outer packages without using import statement.
Packages can contain both Classes and Interfaces
Packages can contain only Java Source files
Sub packages should be declared as private in order to deny importing them
Rate this question:
Both the statements are true
Statement B is true and A is false
Both the statement are false
Statement A is true and B is false
Rate this question:
LinkedList
ArrayList
List
Collection
Rate this question:
Demands a finally block at line number 4
Shows unhandled exception type IOException at line number 5
Demands a finally block at line number 5
Rate this question:
4,5
Compilation error
4,4
5,5
5,4
Rate this question:
Append(short s)
Append(byte b)
Append(int i)
Append(boolean b)
Append(long l)
Rate this question:
1,2,2
2,2,2
0.2,0.5,0.5
2,2,1
Rate this question:
Compile time error; built-in-exceptions like FileNotFoundException cannot be instantiated programmatically
Compiles successfully.But throws runtime error while executing
Compile time error; the declaration does not match the throw statement
Compiles and Runs successfully and prints “xpected caught”
Rate this question:
Line no 1
Line no 4
Line no 3
Line no 2
Rate this question:
True
False
Rate this question:
The elements in the collection are ordered.
The collection is guaranteed to be immutable.
The elements in the collection are guaranteed to be unique.
The elements in the collection are accessed using a unique key.
Rate this question:
It can extend exactly one class and implement exactly one interface.
It can extend exactly one class and can implement multiple interfaces.
It can extend exactly one class or implement exactly one interface.
It can implement multiple interfaces regardless of whether it also extends a class.
Rate this question:
String are immutable, compilation error at line 2.
String are immutable, runtime exception at line 2.
Prints “Welcome”.
Prints “Welcome to Java!”
Rate this question:
True
False
Rate this question:
StringBuffer is a wrapper class
Integer is a wrapper class
Wrapper class contains no methods
String is a wrapper class
Rate this question:
TreeSet
ArrayList
Hashtable
Vector
Rate this question:
Integer.decode()
Integer.intValue()
Integer.getInteger()
Integer.valueOf()
Integer.parseInt()
Rate this question:
Efficient utilization of memory at runtime
Code flexibility at runtime
Avoiding method name confusion at runtime
Code reuse
Rate this question:
True
False
Rate this question:
Serializable
SortTable
Comparable
Rate this question:
Iterator i= HashMap.Iterator();
Iterator i= HashMap.entrySet().Iterator();
Iterator i= HashMap.TreeSet().Iterator();
Rate this question:
Both A and B are true
Both A and B are false
Only A is true
Only B is true
Rate this question:
Quiz Review Timeline (Updated): Mar 21, 2023 +
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.