Java Collections questions and answers 100% verified.
Java Collections questions and answers 100% verified. Java Collections Framework - correct answers.A unified architecture for representing and manipulating collections Contain: Interfaces-ADTs that represent collections Implementations-concrete implementations of the collection interfaces Algorithms-methods that perform useful computations on objects that implement collection interfaces Benefits of Using Java Collections - correct answers.Reduces programing effort Increases program speed and quality Fosters software reuse Collection - correct root of the collection hierarchy ex: the courses making up a student's schedule Set - correct answers.a collection that cannot contain duplicate elements HashSet - correct ment the Set interface a set backed by a hash table; no guarantees as to the iteration order of the set; offers constant time performance for the basic set operations TreeSet - correct ment the Set interface based on a tree map; ordered using natural ordering, or by a Comparator provided at set creation time; offers a guaranteed log(n) time cost for the basic operations List - correct ordered collection (sometimes called a sequence); can contain duplicate elements; have precise control over where each element is inserted in the list and can be access elements by their integer index (position) ArrayList - correct ments the List interface resizable-array implementation; provides methods to manipulate the size of the array that is used internally to store the list. LinkedList - correct ments the List interface Doubly-linked list implementation of the List and Deque interfaces. Vector - correct ments the List interface same as ArrayList except this class is "synchronized," meaning that all operation are thread-safe, ie operations support concurrent access by multiple threads Stack - correct ments the List interface represents a last in, first out stack of objects; extends the class Vector with 5 operations that allow a vector to be treated as a stack Queue - correct answers.a collection used to hold multiple elements prior to processing; provides additional insertion, extraction and inspection operations typically, but don't necessarily, order elements in a first in, first out manner PriorityQueue - correct ments the Queue interface an unbounded priority queue based on a priority heap; ordered according to their natural ordering, or by a Comparator provided at queue construction time Deque - correct answers.a collection used to hold multiple elements prior to processing; provides additional insertion, extraction, and inspection operations ArrayDeque - correct ments the Deque interface resizable-array implementation; not thread-safe Map - correct object that maps keys to values cannot contain duplicate keys; each key can map to a most one value HashMap - correct ment the Map interface a hash table based implementation; no guarantees as to the order of the map HashTable - correct ment Map inteface same as HashMap except this class is "synchronized" aka thread-safe SortedSet - correct answers.a Set that maintains its elements in ascending order SortedMap - correct answers.a Map that maintains its mappings in ascending key order Using Java Collections - correct answers.Used via their interfaces ex: List<Person> list = newArrayList<Person>(); Traversing Collections - correct answers.For Comprehensions Iterators Both allow you to concisely traverse a collection or array Bulk Operations - correct rm an operation on an entire collection ex: containsAll, addAll, removeAll, retainAll, clear Collection Interface Array Operations - correct Array methods are provided as a bridge b/w collections and older APIs that expect arrays on input Comparator - correct object that encapsulates an ordering .Collections - correct sts exclusively of static methods that operate on or return collections Other Collections Methods - correct ySearch, copy, frequency, min and max, reverse, shuffle, sort JavaBeans - correct to represent the property of an object Binding - correct answers.a powerful mechanism for expressing direct relationships b/w variable *When objects participate in binding, changes made to one object will automatically be reflected in another object ObservableValue - correct a change listener to be notified when a property's value has changed. Bindings - correct bled from one or more sources, known as dependencies Useful in a variety of ways- used in a bill invoice tracking program, where the total of all bills would automatically be updated whenever an individual bill is changed Binding APIs - correct answers.High-Level API: simple way to create bindings for the most common use cases Low-Level API: provides additional flexibility, and can be used by advanced developers in situations where the High-Level API is insufficient Lazily - correct a dependency changes, the result of a binding is not immediately recalculated, but it's marked as invalid Change event - correct ates that the value has changed; requires eager evaluation
Written for
- Institution
- Java Collections
- Course
- Java Collections
Document information
- Uploaded on
- September 12, 2023
- Number of pages
- 4
- Written in
- 2023/2024
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
-
java collections questions
Also available in package deal