Java Collection Framework Question and Answers
17. | Why we override equals() method? |
---|---|
The equals() method is used to check whether two objects are same or not. It needs to be overridden if we want to check the objects based on property. | |
18. | What is the advantage of properties file? |
---|---|
|
|
19. | java.util.regex consists of which classes? |
---|---|
java.util.regex consists of three classes: Pattern class, matcher class and PatternSyntaxException class. | |
20. | How do you remove element during Iteration? |
---|---|
Iterator also has a method remove() when remove is called, the current element in the iteration is deleted. | |