DEV Community

Core Java
- What is the difference between
==
and.equals()
in Java? - Explain the concept of immutability in Java.
- What is the purpose of the
final
keyword 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
super
keyword in Java? - How do you handle exceptions in Java? Explain
try-catch-finally
. - What is the difference between
checked
andunchecked
exceptions? - What is the purpose of the
static
keyword in Java? - Can you overload the
main
method in Java? If yes, how? - What is the difference between
ArrayList
andLinkedList
? - How does Java garbage collection work?
- What is the difference between
HashMap
andHashtable
? - 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
volatile
keyword? - 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
transient
andvolatile
keywords? - What is the purpose of the
Object
class in Java?
Collections Framework
- What is the difference between
List
,Set
, andMap
? - How does
HashSet
ensure uniqueness of elements? - What is the time complexity of operations in
ArrayList
vsLinkedList
? - What is the difference between
Iterator
andListIterator
? - How does
TreeSet
maintain sorting order? - What happens if we add a
null
value to aHashMap
? - What is the difference between
poll()
andremove()
inQueue
? - Explain the working of
ConcurrentHashMap
. - What is the difference between
fail-fast
andfail-safe
iterators? - How does
PriorityQueue
work? - What is the difference between
Comparable
andComparator
? - What is the purpose of the
retainAll()
method in collections? - How does
Vector
differ fromArrayList
? - What is the difference between
keySet()
andentrySet()
inMap
? - How do you sort a
List
of custom objects?
Java 8 Features
- What are lambda expressions in Java?
- What is a functional interface? Give examples.
- What is the difference between
forEach
andfor-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
Optional
class? - 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
this
andsuper
? - What is the difference between
abstract
classes and interfaces in Java 8+? - What is encapsulation? Why is it important?
- What is the difference between
private
,protected
, andpublic
access modifiers? - What is the purpose of the
toString()
method? - What is the difference between
instanceof
andisInstance()
?
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
ClassNotFoundException
andNoClassDefFoundError
? - What is the difference between
String pool
and heap memory? - What is the purpose of the
ClassLoader
in Java? - What is the difference between
serializable
andexternalizable
? - 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
Runnable
andCallable
? - What is the purpose of the
ExecutorService
? - What is thread pooling? Why is it used?
- What is the difference between
synchronized
andReentrantLock
? - 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
@Autowired
and@Qualifier
? - What is the difference between
@Component
,@Service
, and@Repository
? - What is the purpose of the
@Transactional
annotation? - What is Spring Boot? How is it different from Spring Framework?
- What is the purpose of the
application.properties
file? - What is the difference between
singleton
andprototype
scopes in Spring? - What is AOP (Aspect-Oriented Programming)?
- What is the difference between
@Controller
and@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
SessionFactory
in Hibernate? - What are the different states of an entity in Hibernate?
- What is the difference between
save()
andpersist()
? - What is the purpose of the
@Entity
annotation? - 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
@Transactional
annotation in Hibernate?
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)