Вы находитесь на странице: 1из 2

1. OOPs Concepts.

2. What is Enumeration? How is it achieved in java?


3. How to find loop in a linked list.
4. Static block and instance block scenario.
Class Test{
Static{
S.O.P(“Hi”);
}

{
S.O.P(“Hello”);
}

Main(){
Test obj1 = new Test();
S.O.P(“Harman”);
Test obj2 = new Test();
}

}
5. How to create singleton class?
a. Can we create singleton class without final?
b. What is double checked singleton?
c. Where to use it?
d. What is volatile?
6. What is immutable class and how to achieve it?
a. Where to use it?
b. What are built in immutable classes?
c. How to create an immutable class.
7. Hashmap implementation, How index is decided for storing an entry.
a. equals() and hascode() method contract, and why we use them.
b. HashMap vs HashTable().
c. What will happen If one thread “t1” is iterating through HashMap and
another thread “t2” tries to delete an entry from the HashMap at the
same time.
d. ConcurrentModificationException
e. How iterator internally checks for ConcurrentModificationException.
8. ConcurrentHashmap working.
9. What is serialization?
a. What is serialization version id?
b. Can we avoid writing serialization version id?
c. Use of “transient”.
d. We have a class with 100 variables. How to restrict 50 variables from
serialization.
10. What is iterator?
a. What is fail-safe and fail-fast?
b. Example of fail-fast iterators.
11. Exception hierarchy?
a. Difference between Error and Exception.
b. Example of RuntimeException.
c. Exception handling mechanism in overridden methods.
12. Difference between classcastexception and noclassdeffounderror.
13. Types of inner classes.
14. Deep copy vs shallow copy.
15. What is default garbage collector in Java 1.7? Different types of GC.
16. What is comparator and comparable?
17. Difference between interrupt and notify.
18. What will be the output of the below program:
class A {
public void m1(String s){
System.out.println("Hi");
}
public void m1(Object o){
System.out.println("Hello");
}
}

class B extends A{
public void m1(String s){
System.out.println("SubClass");
}

}
class MainClass{
public static void main(String args[]){
A obj = new B();
obj.m1(“abc”); // Case 1
obj.m1(4); // Case 2
}
}

19. Find max salary from employee table (SQL).


20. How to search in a file in Linux.

Вам также может понравиться