Core Java
- What is the difference between
==and.equals()in Java? - Explain the concept of immutability in Java.
- What is the purpose of the
finalkeyword in Java? - How does Java achieve platform independence?
- What is the difference between
String,StringBuilder, andStringBuffer? - Explain the concept of method overloading and overriding.
- What is the use of the
superkeyword in Java? - How do you handle exceptions in Java? Explain
try-catch-finally. - What is the difference between
checkedanduncheckedexceptions? - What is the purpose of the
statickeyword in Java? - Can you overload the
mainmethod in Java? If yes, how? - What is the difference between
ArrayListandLinkedList? - How does Java garbage collection work?
- What is the difference between
HashMapandHashtable? - Explain the concept of multithreading in Java.
- What are the different ways to create threads in Java?
- What is the difference between
sleep()andwait()? - What is the purpose of the
volatilekeyword? - How does Java support encapsulation?
- What is the difference between an abstract class and an interface?
- Can we instantiate an abstract class? Why or why not?
- What is the difference between
compareTo()andcompare()? - What is autoboxing and unboxing in Java?
- What is the difference between
transientandvolatilekeywords? - What is the purpose of the
Objectclass in Java?
Collections Framework
- What is the difference between
List,Set, andMap? - How does
HashSetensure uniqueness of elements? - What is the time complexity of operations in
ArrayListvsLinkedList? - What is the difference between
IteratorandListIterator? - How does
TreeSetmaintain sorting order? - What happens if we add a
nullvalue to aHashMap? - What is the difference between
poll()andremove()inQueue? - Explain the working of
ConcurrentHashMap. - What is the difference between
fail-fastandfail-safeiterators? - How does
PriorityQueuework? - What is the difference between
ComparableandComparator? - What is the purpose of the
retainAll()method in collections? - How does
Vectordiffer fromArrayList? - What is the difference between
keySet()andentrySet()inMap? - How do you sort a
Listof custom objects?
Java 8 Features
- What are lambda expressions in Java?
- What is a functional interface? Give examples.
- What is the difference between
forEachandfor-loop? - Explain the concept of streams in Java.
- What is the difference between
map()andflatMap()? - What are default methods in interfaces?
- What is the purpose of the
Optionalclass? - How does
Stream.collect()work? - What are method references in Java?
- What is the difference between intermediate and terminal operations in streams?
OOPs Concepts
- What is polymorphism? Explain its types.
- What is inheritance? What are its advantages and disadvantages?
- What is the difference between composition and aggregation?
- What is the diamond problem in Java? How is it resolved?
- What is the difference between
thisandsuper? - What is the difference between
abstractclasses and interfaces in Java 8+? - What is encapsulation? Why is it important?
- What is the difference between
private,protected, andpublicaccess modifiers? - What is the purpose of the
toString()method? - What is the difference between
instanceofandisInstance()?
Advanced Java
- What is the difference between
JVM,JRE, andJDK? - What is reflection in Java? Provide an example.
- What is the purpose of annotations in Java?
- What is the difference between
ClassNotFoundExceptionandNoClassDefFoundError? - What is the difference between
String pooland heap memory? - What is the purpose of the
ClassLoaderin Java? - What is the difference between
serializableandexternalizable? - What is the purpose of the
clone()method? - What is the difference between shallow copy and deep copy?
- What is the purpose of the
finalize()method?
Concurrency and Multithreading
- What is the difference between
RunnableandCallable? - What is the purpose of the
ExecutorService? - What is thread pooling? Why is it used?
- What is the difference between
synchronizedandReentrantLock? - What is the difference between
start()andrun()methods in threads? - What is thread starvation? How can it be avoided?
- What is a deadlock? How can it be prevented?
- What is the purpose of
ThreadLocal? - What is the difference between
notify()andnotifyAll()? - What is the purpose of the
ForkJoinPool?
Spring Framework (if applicable)
- What is dependency injection? How does Spring implement it?
- What is the difference between
@Autowiredand@Qualifier? - What is the difference between
@Component,@Service, and@Repository? - What is the purpose of the
@Transactionalannotation? - What is Spring Boot? How is it different from Spring Framework?
- What is the purpose of the
application.propertiesfile? - What is the difference between
singletonandprototypescopes in Spring? - What is AOP (Aspect-Oriented Programming)?
- What is the difference between
@Controllerand@RestController? - What is the purpose of the
DispatcherServlet?
Hibernate (if applicable)
- What is the difference between
get()andload()in Hibernate? - What is lazy loading? How does it work?
- What is the purpose of the
SessionFactoryin Hibernate? - What are the different states of an entity in Hibernate?
- What is the difference between
save()andpersist()? - What is the purpose of the
@Entityannotation? - What is HQL (Hibernate Query Language)?
- What is the difference between
merge()andupdate()? - What is the second-level cache in Hibernate?
- What is the purpose of the
@Transactionalannotation in Hibernate?
Top comments (0)