What is the difference between a shallow copy and a deep copy?
Why is a copy constructor preferable to the clone method?
What is the difference between the identity operator and the equals() method?
What is the relationship between the hashCode()
method and the
equals() method?
What is the default implementation of the toString() method?
Why is the finalize() method unreliable for cleanup operations?
Composition & Inheritance
What is the difference between composition and inheritance?
What is the difference between method overriding and method overloading?
How would you determine whether to use composition or inheritance?
Abstract Classes & Interfaces
What is the difference between an abstract class and an interface?
How would you determine whether to use an abstract class or an interface?
Why can’t a class be declared both final and abstract?
What is the value of designing a codebase around the use of interfaces?
What are anonymous classes used for?
What is a closure?
What is a lambda expression?
Exceptions
What is an exception?
What is the difference between an unchecked and a checked exception?
How would you determine whether to use an unchecked or a checked exception?
How does a try/catch/finally block work?
How does the try-with-resources statement work?
Generics
What is the difference between a compile-time error and a runtime error?
What is the purpose of generics?
What are the different types of generic wildcards?
What is type erasure?
What are some of the limitations of generics?
Concurrency
What is the lifecycle of a Thread?
Why is synchronization necessary on shared resources?
What is used as a lock for synchronized
static and synchronized
nonstatic methods?
What would happen if two different threads hit
two synchronized nonstatic
methods on the same object simultaneously?
What would happen if two different threads hit a synchronized
static method and
synchronized nonstatic method on the same object simultaneously?
What one thing does the volatile keyword guarantee about a variable?
What two things does the synchronize keyword guarantee about a block of code?
What are some built-in concurrent data structures?
What is the executor framework?
What is a ThreadLocal variable?
What are atomic variables?
Dostları ilə paylaş: