Java Collections Programming Interview Questions Answers - 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.
What is the difference between comparable and comparator?
- 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 provides multiple sorts of sequences.
- It provides one method named compare().
- It is found in java.util.package.
- Actual class is not modified.
What is locale?
A Locale object represents a specific geographical, political or cultural region.
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.
Which package is used for pattern matching with regular expressions?
java.util.regex package is used for this purpose.
SAP SD Interview Questions and Answers More
Top 1000+ Bank Exams Question Papers with Answers Pdf More
1000+ SBI Computer Awareness Study Material More
Top 1000+ Preposition Questions for SSC Exams More
Preposition Quiz Questions and Answers for Bank Exams More
Top 151+ Sports General Knowledge Questions and Answers More
100+ Chemistry Chemical Bonding Questions and Answers Pdf More
MS Windows Objective Questions and Answers Pdf More
100+ English Language Questions & Answers for Bank Exam Pdf More
Operating System Question Bank for Bank PO, SO, Clerk Exams More