Java Collection Framework Question and 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.
 
Your Name Your Email-ID
Your Answer
2. What is locale?
  A Locale object represents a specific geographical, political or cultural region.
 
Your Name Your Email-ID
Your Answer
3. What are collection related features in Java 8?
  Java 8 has brought major changes in the Collection API. Some of the changes are
  • Java Stream API for collection classes for supporting sequential as well as parallel processing.
  • Iterable interface is extended with forEach() default method that we can use to iterate over a collection.
  • It is very helpful when used with lambda expressions because its argument.
 
Your Name Your Email-ID
Your Answer
4. What is the vector class?
 
  • The vector class implements an incremental array of objects.
  • The vector components can be accessed using an integer index.
  • The size of a Vector increases or decreases as needed to accommodate the items.
 
Your Name Your Email-ID
Your Answer
1234 Page 1 of 4