Welcome to Tekiana Quiz



1. Can an Abstract class be final

Yes
No


2. If obj1. equals(obj2) = true. Then

Hashcode of obj1 and obj2 will be same
Hashcode of obj1 and obj2 will be different


3. Which of the following collections are thread-safe?

Hashmap
Hashtable


4. What will be output of following code?
abstract final class AbstractFinalClass{}

ClassCastException
Compiles without Error
Can be either abstract or final, not both
None of the above


5. When do flattening of object happens?

During Serialization
During DeSerialization
Both of the above
None of the above


6. A set doesn’t allow duplicate elements

True
False


7. class A implements java.lang.Runnable will override

public void run()
void run()
void start()
None of the Above


8. Is it possible to change visibility of an inherited method

Yes
No


9. If the size of data is well known, which of the following will be preferred based on performance metric

Array
Array List


10. What will be output of following code
public class Tek{
public static void main(String[] args){
HashSet h=new HashSet ();
h.add(johny);
h.add(johny);
h.add(johny);
System.out.println(h.size());}}

1
2
3
0