Java Interview Questions
-
What do you need to ensure about the object that is a key of a Map.
public boolean equals(Object o) public int hashCode() // hashCode must be equal for all objects a and b with a.equal(b) == true.
-
Explain synchronized keyword.
-
Java concurrency - how to protect data from concurrent access.
-
Explain the use of try, catch, finally.
-
What is the object hierarchy of exceptions.