Java Collections Programming Interview Questions Answers - 1
Question: 1
What is java collections frameworks?
- Collections are used in every programming language and initial java release contained few classes for collections: Vector, Stack, Hashtables, Array.
- But looking at the larger scope and usage, Java 1.2 cane up with Collections Framework that group all the collection interfaces, implementations and algorithms.
Some of the benefits of collection framework are
- Reduced development effort by using core collection classes rather than implementing our own collection classes.
- Code quality is enhanced with the use of well tested collections framework classes.
- Reusability and Interoperability
- Reduced effort for code maintenance by using collection classes shipped with JK.
Question: 2
What is the difference between comparable and comparator?
Comparable
- Comparable provides only one sort of sequence.
- It provides one method named compareTo().
- It is found in java.lang.package.
- If we implement Comparable interface, actual class is modified.
Comparator
- Comparator provides multiple sorts of sequences.
- It provides one method named compare().
- It is found in java.util.package.
- Actual class is not modified.
Question: 3
What is locale?
A Locale object represents a specific geographical, political or cultural region.
Question: 4
What is the dictionary class?
- The Dictionary class is an abstract class.
- The class maps keys to values.
- The classes such as Hash Tables are the sub classes of the abstract class Dictionary.
- The key and values are objects.
- The key and value are non null objects.
- The Dictionary Class provides the capability to store key value pairs.
Question: 5
Which package is used for pattern matching with regular expressions?
java.util.regex package is used for this purpose.
Related Questions
Recent Articles
Agricultural Engineering MCQ Questions & Answers Pdf More
Surveying and Levelling Agricultural Engineering MCQ Questions More
Electromagnetic Induction Questions & Answers Pdf More
A.C. Basics and Networks Quiz Questions & Answers Pdf More
Signals and Systems Quiz Questions and Answers Pdf More
Signals and Systems MCQ Questions and Answers Pdf More
April-28-2024
| Meritnotes
Surveying and Levelling Agricultural Engineering MCQ Questions More
April-27-2024
| Meritnotes
Electromagnetic Induction Questions & Answers Pdf More
April-27-2024
| Meritnotes
A.C. Basics and Networks Quiz Questions & Answers Pdf More
April-26-2024
| Meritnotes
Signals and Systems Quiz Questions and Answers Pdf More
April-25-2024
| Meritnotes
Signals and Systems MCQ Questions and Answers Pdf More
April-24-2024
| Meritnotes
Trending Posts
Astronomy Objective Type Questions and Answers More
7000+ GATE Metallurgy Question Paper with Solution Pdf More
1000+ TNPSC General Science Study Material in English Pdf More
1000+ Mechatronics Objective Questions and Answers Pdf More
TNPSC Group 4 Biology Study Material in English Tamil More
General Science Online Test | Current Affairs 2020-2021 More
August-28-2019
| Meritnotes
7000+ GATE Metallurgy Question Paper with Solution Pdf More
March-03-2024
| Meritnotes
1000+ TNPSC General Science Study Material in English Pdf More
June-03-2023
| Meritnotes
1000+ Mechatronics Objective Questions and Answers Pdf More
June-22-2022
| Meritnotes
TNPSC Group 4 Biology Study Material in English Tamil More
August-28-2019
| Meritnotes
General Science Online Test | Current Affairs 2020-2021 More
February-19-2020
| Meritnotes