Outer o = new Outer(); Outer.Inner oi = o.new Outer.Inner();
Outer.Inner o = new Outer.Inner();
Outer.Inner oi = new Inner();
Inner oi = new Outer.Inner();
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
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
Compile time error
Run time error
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
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
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
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
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
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
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
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
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
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
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
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”
Line no 1
Line no 4
Line no 3
Line no 2
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.
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.
String are immutable, compilation error at line 2.
String are immutable, runtime exception at line 2.
Prints “Welcome to Java!”
StringBuffer is a wrapper class
Integer is a wrapper class
Wrapper class contains no methods
String is a wrapper class
Efficient utilization of memory at runtime
Code flexibility at runtime
Avoiding method name confusion at runtime
Iterator i= HashMap.Iterator();
Iterator i= HashMap.entrySet().Iterator();
Iterator i= HashMap.TreeSet().Iterator();
Both A and B are true
Both A and B are false
Only A is true
Only B is true