

{"id":11882,"date":"2018-03-27T08:46:29","date_gmt":"2018-03-27T08:46:29","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=11882"},"modified":"2026-05-22T16:23:01","modified_gmt":"2026-05-22T10:53:01","slug":"collection-framework-in-java","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/collection-framework-in-java\/","title":{"rendered":"Collection Framework in Java &#8211; Hierarchy, Need &amp; Advantages"},"content":{"rendered":"<p>In the day-to-day life of a programmer, we are required to maintain a given set of data. Therefore, Java has different collections like lists, stacks, queues, etc., to maintain this set of data. However, to make the work of a programmer even simpler, Java also has a collection framework, which implicitly uses collections to maintain a set of data. In this article, we will take a look at exactly what the Java collection framework is and what the main advantages of using the collection framework are.<\/p>\n<h3>Collection in Java<\/h3>\n<p>A collection is a group of individual data that are grouped to form a single unit. However, Collections are containers that hold multiple data items as a single unit. For example, if we store the names of all the employees in a single list and name it Employee, it will form a collection.<br \/>\n<strong>The two root interfaces of the Java collection class are:<\/strong><\/p>\n<ul>\n<li>Collection interface(java.util.collection)<\/li>\n<li>Map interface(java.util.Map)<\/li>\n<\/ul>\n<h3>Collection Framework in Java<\/h3>\n<p>Collection Framework in Java is an architecture using which we can use to represent a collection of interfaces and classes. Therefore, it is used in storing, maintaining, and handling data effectively.<br \/>\nThe collection framework makes manipulation of the collection easier. As a result, this makes the task of a programmer simpler.<\/p>\n<h3>Hierarchy of Collection Framework in Java<\/h3>\n<p>As we know, the collection framework is an architecture of classes and interfaces. Let us now see their hierarchy.<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/hierarchy-of-collection-framework-in-java.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-109005\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/hierarchy-of-collection-framework-in-java.webp\" alt=\"hierarchy of collection framework in java\" width=\"1296\" height=\"752\" \/><\/a><\/p>\n<h3>Need for Java Collection Framework<\/h3>\n<p>The Java collection framework was introduced from Java 1.2; before that, Java had some ad hoc classes like vector, properties, stack, hash tables, dictionary, etc to store and handle data. Moreover, these classes were useful but did not have the same interface,i.e, the technique of storing data was different for different classes. That is why the collection framework was introduced in Java 1.2 to make these classes unified.<\/p>\n<h3>Goals of Collection Framework in Java<\/h3>\n<ul>\n<li>To increase the efficiency of the fundamental collections like dynamic arrays, trees, linked lists, and hash tables, etc.<\/li>\n<li>To increase compatibility by letting all the collections work identically.<\/li>\n<li>For increasing flexibility by easily extending and\/or adapting a collection.<\/li>\n<li>To increase the efficiency of the code due to the high optimization of the collection framework.<\/li>\n<li>To increase the uniqueness of data by providing a set interface.<\/li>\n<li>For making the organization of data easier by storing the data in a key-value pair using the Map interface.<\/li>\n<li>To increase the flexibility of arrays by using the ArrayList class.<\/li>\n<li style=\"font-weight: 400\"><span style=\"font-weight: 400\">It optimises the use of Java collections to improve the performance time and speed of sorting the data, to process it quickly.<\/span><\/li>\n<\/ul>\n<h3>Composition of Java Collection Frameworks<\/h3>\n<p>All collection frameworks in Java include the following three elements:<br \/>\n1. Interfaces<br \/>\n2. Implementation of classes<br \/>\n3. Collection Algorithms<\/p>\n<p>Let us discuss them individually.<\/p>\n<h4>1. Interfaces in Java<\/h4>\n<p>The main architecture of the Java collection framework stands on the basis of interfaces. Thus, Interfaces are abstract data types that represent collections in the framework. Although using interfaces, we can manipulate collections irrespective of the way they are represented in memory. However, all these interfaces are part of the utility package of Java, i.e, java.util.<\/p>\n<p>The root of the Collection framework interfaces is java.util.Collections. Therefore, it consists of several important methods that the programmer uses in their day-to-day life. Some of these methods include add(), size(), remove(), etc.<br \/>\nMoreover, every other interface implements Java. util.Collection interface, for example, Set, Queue, etc. Hence, the only interface that does not implement the collection interface but is part of the framework is the Map interface.<\/p>\n<p>However, the table below tells about the different interfaces and their work in the Collection framework.<\/p>\n<table>\n<tbody>\n<tr>\n<td><b>SL. No.<\/b><\/td>\n<td><b>Interface<\/b><\/td>\n<td><b>Description<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">1<\/span><\/td>\n<td><span style=\"font-weight: 400\">Collection<\/span><\/td>\n<td><span style=\"font-weight: 400\">This is the root interface and is present at the top of the Collection hierarchy, and allows us to work with a group of objects.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">2<\/span><\/td>\n<td><span style=\"font-weight: 400\">List<\/span><\/td>\n<td><span style=\"font-weight: 400\">This interface extends the Collection interface and is used to store data in the form of a list. Hence, the object of a list stores elements in an ordered form.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">3<\/span><\/td>\n<td><span style=\"font-weight: 400\">Set<\/span><\/td>\n<td><span style=\"font-weight: 400\">This interface extends the Collection interface and handles a set of data with unique elements.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">4<\/span><\/td>\n<td><span style=\"font-weight: 400\">SortedSet<\/span><\/td>\n<td><span style=\"font-weight: 400\">This interface extends the Set interface and is used to handle the set of elements that are sorted.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">5<\/span><\/td>\n<td><span style=\"font-weight: 400\">Map<\/span><\/td>\n<td><span style=\"font-weight: 400\">This interface does not extend any other interfaces. Thus, it is used to map the data in the form of keys and values.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">6<\/span><\/td>\n<td><span style=\"font-weight: 400\">SortedMap<\/span><\/td>\n<td><span style=\"font-weight: 400\">This interface extends the Map interface and is used to maintain the keys in ascending order.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">7<\/span><\/td>\n<td><span style=\"font-weight: 400\">Map.Entry<\/span><\/td>\n<td><span style=\"font-weight: 400\">This is an inner class of the Map interface that is used to represent elements(Both keys and values) on a map.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">8<\/span><\/td>\n<td><span style=\"font-weight: 400\">Enumeration<\/span><\/td>\n<td><span style=\"font-weight: 400\">This is a legacy interface that is used to enumerate data one at a time in the collection of objects.<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>2. Implementation of classes in Java<\/h4>\n<p>Java collection framework architecture\u2019s next component is the implemented classes. However, these classes are the concrete implementation of the collection interface, i.e, these classes are reusable data structures. Therefore, we can use them repeatedly to create different collections in our code. However, some of the most important classes are ArrayList, LinkedList, HashMap, TreeMap, HashSet, TreeSet, etc. Therefore, we can even create our own customized collection classes.<\/p>\n<p>Let us understand the main classes of the collection framework by the following table:<\/p>\n<table>\n<tbody>\n<tr>\n<td><b>SL. No.<\/b><\/td>\n<td><b>Class<\/b><\/td>\n<td><b>Description<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">1<\/span><\/td>\n<td><span style=\"font-weight: 400\">AbstractCollection<\/span><\/td>\n<td><span style=\"font-weight: 400\">This class implements most of the Collection interfaces.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">2<\/span><\/td>\n<td><span style=\"font-weight: 400\">AbstractList<\/span><\/td>\n<td><span style=\"font-weight: 400\">This class extends AbstractCollection and implements most of the list interfaces.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">3<\/span><\/td>\n<td><span style=\"font-weight: 400\">AbstractSequentialList<\/span><\/td>\n<td><span style=\"font-weight: 400\">This class extends the AbstractList class. Hence, it is used to perform sequential access to a collection of elements rather than random access<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">4<\/span><\/td>\n<td><span style=\"font-weight: 400\">LinkedList<\/span><\/td>\n<td><span style=\"font-weight: 400\">This class is used to implement a linked list. However, this class also extends the AbstractList class.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">5<\/span><\/td>\n<td><span style=\"font-weight: 400\">ArrayList<\/span><\/td>\n<td><span style=\"font-weight: 400\">This class is used to create a dynamic and flexible array. Therefore, it extends the AbstractList class.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">6<\/span><\/td>\n<td><span style=\"font-weight: 400\">AbstractSet<\/span><\/td>\n<td><span style=\"font-weight: 400\">This class extends the AbstractCollection class and implements most of the Set interface.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">7<\/span><\/td>\n<td><span style=\"font-weight: 400\">HashSet<\/span><\/td>\n<td><span style=\"font-weight: 400\">This class is used to work with Hash Tables. Thus, the class extends the AbstractSet.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">8<\/span><\/td>\n<td><span style=\"font-weight: 400\">LinkedHashSet<\/span><\/td>\n<td><span style=\"font-weight: 400\">This class allows iteration in insertion order and extends the HashSet class.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">9<\/span><\/td>\n<td><span style=\"font-weight: 400\">TreeSet<\/span><\/td>\n<td><span style=\"font-weight: 400\">This class is used to implement the set stored in a tree. Thus, it extends the AbstractSet Class.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">10<\/span><\/td>\n<td><span style=\"font-weight: 400\">AbstractMap<\/span><\/td>\n<td><span style=\"font-weight: 400\">This class implements most of the Map interfaces.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">11<\/span><\/td>\n<td><span style=\"font-weight: 400\">TreeMap<\/span><\/td>\n<td><span style=\"font-weight: 400\">This class is used to implement a tree. However, it extends the AbstractMap Class.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">12<\/span><\/td>\n<td><span style=\"font-weight: 400\">HashMap<\/span><\/td>\n<td><span style=\"font-weight: 400\">This class is used to implement a hash table. Although it extends the AbstractMap class.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">13<\/span><\/td>\n<td><span style=\"font-weight: 400\">WeakHashMap<\/span><\/td>\n<td><span style=\"font-weight: 400\">This class is used to implement a hash table with weak keys. It extends the AbstractMap Class.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">14<\/span><\/td>\n<td><span style=\"font-weight: 400\">LinkedHashMap<\/span><\/td>\n<td><span style=\"font-weight: 400\">This class is used to perform iteration in insertion order. Thus, this class extends the HashMap class.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">15<\/span><\/td>\n<td><span style=\"font-weight: 400\">IdentityHashMap<\/span><\/td>\n<td><span style=\"font-weight: 400\">This class uses reference equality when comparing documents. Therefore, it extends the AbstractMap class.<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>3. Java Collection Algorithms<\/h4>\n<p>The collection framework has several predefined algorithms that can be applied to the Collection and Map interfaces. However, these algorithms are defined as static methods and are present inside the Collection interface. Hence, these algorithms are polymorphic, i.e, they can be implemented as many times as required.<\/p>\n<p>However, Many of these methods can throw a ClassCastException, which occurs when an attempt is made to compare incompatible types, or an UnsupportedOperationException, which occurs when an attempt is made to modify an unmodifiable collection.<\/p>\n<p>The following table explains all the collection framework algorithms:<\/p>\n<table>\n<tbody>\n<tr>\n<td><b>SL. No.<\/b><\/td>\n<td><b>Method<\/b><\/td>\n<td><b>Description<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">1<\/span><\/td>\n<td><span style=\"font-weight: 400\">static int binarySearch(List list, Object value, Comparator c)<\/span><\/td>\n<td><span style=\"font-weight: 400\">This method searches for a value in the list ordered according to c. Thus, returns the position of the value in the list, or -1 if the value is not found.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">2<\/span><\/td>\n<td><span style=\"font-weight: 400\">static int binarySearch(List list, Object value)<\/span><\/td>\n<td><span style=\"font-weight: 400\">This method searches for a value in the list. The list must be sorted. Thus, Returns the position of the value in the list, or -1 if the value is not found.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">3<\/span><\/td>\n<td><span style=\"font-weight: 400\">static void copy(List list1, List list2)<\/span><\/td>\n<td><span style=\"font-weight: 400\">This method copies the elements of list2 to list1.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">4<\/span><\/td>\n<td><span style=\"font-weight: 400\">static Enumeration enumeration(Collection c)<\/span><\/td>\n<td><span style=\"font-weight: 400\">This method returns an enumeration over c.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">5<\/span><\/td>\n<td><span style=\"font-weight: 400\">static void fill(List list, Object obj)<\/span><\/td>\n<td><span style=\"font-weight: 400\">This method assigns obj to each element of the list.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">6<\/span><\/td>\n<td><span style=\"font-weight: 400\">static int indexOfSubList(List list, List subList)<\/span><\/td>\n<td><span style=\"font-weight: 400\">This method searches a list for the first occurrence of subList. Hence,\u00a0 returns the index of the first match, or .1 if no match is found.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">7<\/span><\/td>\n<td><span style=\"font-weight: 400\">static int lastIndexOfSubList(List list, List subList)<\/span><\/td>\n<td><span style=\"font-weight: 400\">This method searches a list for the last occurrence of subList. Therefore, Returns the index of the last match, or .1 if no match is found.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">8<\/span><\/td>\n<td><span style=\"font-weight: 400\">static ArrayList list(Enumeration enum)<\/span><\/td>\n<td><span style=\"font-weight: 400\">This method returns an ArrayList that contains the elements of an enum.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">9<\/span><\/td>\n<td><span style=\"font-weight: 400\">static Object max(Collection c, Comparator comp)<\/span><\/td>\n<td><span style=\"font-weight: 400\">This method returns the maximum element in\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400\">c as determined by comp.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">10<\/span><\/td>\n<td><span style=\"font-weight: 400\">static Object max(Collection c)<\/span><\/td>\n<td><span style=\"font-weight: 400\">This method returns the maximum element in c as determined by natural ordering. Therefore, the collection need not be sorted.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">11<\/span><\/td>\n<td><span style=\"font-weight: 400\">static Object min(Collection c, Comparator comp)<\/span><\/td>\n<td><span style=\"font-weight: 400\">This method returns the minimum element in c as determined by comp. Therefore, the collection need not be sorted.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">12<\/span><\/td>\n<td><span style=\"font-weight: 400\">static Object min(Collection c)<\/span><\/td>\n<td><span style=\"font-weight: 400\">This method returns the minimum element in c as determined by natural ordering.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">13<\/span><\/td>\n<td><span style=\"font-weight: 400\">static List nCopies(int num, Object obj)<\/span><\/td>\n<td><span style=\"font-weight: 400\">This method returns num copies of obj contained in an immutable list. Hence, num must be greater than or equal to zero.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">14<\/span><\/td>\n<td><span style=\"font-weight: 400\">static boolean replaceAll(List list, Object old, Object new)<\/span><\/td>\n<td><span style=\"font-weight: 400\">This method replaces all occurrences of old with new in the list. Hence, returns true if at least one replacement occurred. Returns false, otherwise.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">15<\/span><\/td>\n<td><span style=\"font-weight: 400\">static void reverse(List list)<\/span><\/td>\n<td><span style=\"font-weight: 400\">This method reverses the sequence in a list.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">16<\/span><\/td>\n<td><span style=\"font-weight: 400\">static Comparator reverseOrder( )<\/span><\/td>\n<td><span style=\"font-weight: 400\">This method returns a reverse comparator.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">17<\/span><\/td>\n<td><span style=\"font-weight: 400\">static void rotate(List list, int n)<\/span><\/td>\n<td><span style=\"font-weight: 400\">This method rotates a list by n places to the right. Thus, to rotate left, use a negative value for n.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">18<\/span><\/td>\n<td><span style=\"font-weight: 400\">static void shuffle(List list, Random r)<\/span><\/td>\n<td><span style=\"font-weight: 400\">This method shuffles (i.e., randomizes) the elements in the list by using r as a source of random numbers.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">19<\/span><\/td>\n<td><span style=\"font-weight: 400\">static void shuffle(List list)<\/span><\/td>\n<td><span style=\"font-weight: 400\">This method shuffles (i.e., randomizes) the elements in a list.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">20<\/span><\/td>\n<td><span style=\"font-weight: 400\">static Set singleton(Object obj)<\/span><\/td>\n<td><span style=\"font-weight: 400\">This method returns obj as an immutable set. Therefore, this is an easy way to convert a single object into a set.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">21<\/span><\/td>\n<td><span style=\"font-weight: 400\">static List singletonList(Object obj)<\/span><\/td>\n<td><span style=\"font-weight: 400\">This method returns obj as an immutable list. Although this is an easy way to convert a single object into a list.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">22<\/span><\/td>\n<td><span style=\"font-weight: 400\">static Map singletonMap(Object k, Object v)<\/span><\/td>\n<td><span style=\"font-weight: 400\">This method returns the key\/value pair k\/v as an immutable map. However, this is an easy way to convert a single key\/value pair into a map.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">23<\/span><\/td>\n<td><span style=\"font-weight: 400\">static void sort(List list, Comparator comp)<\/span><\/td>\n<td><span style=\"font-weight: 400\">This method sorts the elements of a list as determined by comp.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">24<\/span><\/td>\n<td><span style=\"font-weight: 400\">static void sort(List list)<\/span><\/td>\n<td><span style=\"font-weight: 400\">This method sorts the elements of the list as determined by their natural ordering.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">25<\/span><\/td>\n<td><span style=\"font-weight: 400\">static void swap(List list, int idx1, int idx2)<\/span><\/td>\n<td><span style=\"font-weight: 400\">This method exchanges the elements in the list at the indices specified by idx1 and idx2.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">26<\/span><\/td>\n<td><span style=\"font-weight: 400\">static Collection synchronizedCollection(Collection c)<\/span><\/td>\n<td><span style=\"font-weight: 400\">This method returns a thread-safe collection backed by c.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">27<\/span><\/td>\n<td><span style=\"font-weight: 400\">static List synchronizedList(List list)<\/span><\/td>\n<td><span style=\"font-weight: 400\">This method returns a thread-safe list backed by a list.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">28<\/span><\/td>\n<td><span style=\"font-weight: 400\">static Map synchronizedMap(Map m)<\/span><\/td>\n<td><span style=\"font-weight: 400\">This method returns a thread-safe map backed by m.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">29<\/span><\/td>\n<td><span style=\"font-weight: 400\">static Set synchronizedSet(Set s)<\/span><\/td>\n<td><span style=\"font-weight: 400\">This method returns a thread-safe set backed by s.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">30<\/span><\/td>\n<td><span style=\"font-weight: 400\">static SortedMap synchronizedSortedMap(SortedMap sm)<\/span><\/td>\n<td><span style=\"font-weight: 400\">This method returns a thread-safe sorted set backed by sm.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">31<\/span><\/td>\n<td><span style=\"font-weight: 400\">static SortedSet synchronizedSortedSet(SortedSet ss)<\/span><\/td>\n<td><span style=\"font-weight: 400\">This method returns a thread-safe set backed by ss.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">32<\/span><\/td>\n<td><span style=\"font-weight: 400\">static Collection unmodifiableCollection(Collection c)<\/span><\/td>\n<td><span style=\"font-weight: 400\">This method returns an unmodifiable collection backed by c.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">33<\/span><\/td>\n<td><span style=\"font-weight: 400\">static List unmodifiableList(List list)<\/span><\/td>\n<td><span style=\"font-weight: 400\">This method returns an unmodifiable list backed by the list.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">34<\/span><\/td>\n<td><span style=\"font-weight: 400\">static Map unmodifiableMap(Map m)<\/span><\/td>\n<td><span style=\"font-weight: 400\">This method returns an unmodifiable map backed by m.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">35<\/span><\/td>\n<td><span style=\"font-weight: 400\">static Set unmodifiableSet(Set s)<\/span><\/td>\n<td><span style=\"font-weight: 400\">This method returns an unmodifiable set backed by s.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">36<\/span><\/td>\n<td><span style=\"font-weight: 400\">static SortedMap unmodifiableSortedMap(SortedMap sm)<\/span><\/td>\n<td><span style=\"font-weight: 400\">This method returns an unmodifiable sorted map backed by sm.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">37<\/span><\/td>\n<td><span style=\"font-weight: 400\">static SortedSet unmodifiableSortedSet(SortedSet ss)<\/span><\/td>\n<td><span style=\"font-weight: 400\">This method returns an unmodifiable sorted set backed by ss.<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>Code to explain the use of algorithms:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">package com.DataFlair.CollectionFramework;\r\nimport java.util.*;\r\npublic class Algorithms\r\n{\r\n    public static void main(String args[]) {\r\n      LinkedList L1 = new LinkedList();\r\n      L1.add(new Integer(15));\r\n      L1.add(new Integer(2));\r\n      L1.add(new Integer(-2));\r\n      L1.add(new Integer(1000));\r\n      Comparator r = Collections.reverseOrder();\r\n      Collections.sort(L1, r);\r\n      Iterator li = L1.iterator();\r\n      System.out.print(\"List sorted in reverse: \");\r\n      while(li.hasNext()) {\r\n         System.out.print(li.next() + \" \");\r\n      }\r\n      System.out.println();\r\n      Collections.shuffle(L1);\r\n      li = L1.iterator();\r\n      System.out.print(\"List shuffled: \");\r\n      while(li.hasNext()) {\r\n         System.out.print(li.next() + \" \");\r\n      }\r\n      System.out.println();\r\n      System.out.println(\"Minimum: \" + Collections.min(L1));\r\n      System.out.println(\"Maximum: \" + Collections.max(L1));\r\n   }\r\n}\r\n\r\n<\/pre>\n<p><strong>The output of the above code:<\/strong><\/p>\n<div class=\"code-output\">List sorted in reverse: 1000 15 2 -2<br \/>\nList shuffled: 15 -2 2 1000<br \/>\nMinimum: -2<br \/>\nMaximum: 1000<\/div>\n<p>As we can see, the use of algorithms can make programs short and simple.<\/p>\n<h3>Java Iterator Interface in the Collection Framework<\/h3>\n<p>There is no point in storing data using collections if we can&#8217;t cycle through them. However, Java provides us with a very simple interface to do this, known as Iterator or ListIterator, depending on the type of collection that needs to be iterated. Moreover, an iterator enables you to cycle through a collection to obtain or remove elements.<\/p>\n<p>Moreover, ListIterator extends the Iterator interface to allow bidirectional traversal of a list and the modification of elements. However, these are very useful, especially in the case of various operations that require constant cycling through the list.<\/p>\n<p><strong>Code to understand Iterator implementation:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">package com.DataFlair.CollectionFramework;\r\nimport java.util.*;\r\npublic class Iterators\r\n{\r\n     public static void main(String args[]) \r\n     {\r\n      ArrayList al = new ArrayList();\r\n      al.add(\"D\");\r\n      al.add(\"A\");\r\n      al.add(\"T\");\r\n      al.add(\"A\");\r\n      al.add(\"F\");\r\n      al.add(\"L\");\r\n      al.add(\"A\");\r\n      al.add(\"I\");\r\n      al.add(\"R\");\r\n      System.out.print(\"Original contents of al: \");\r\n      Iterator itr = al.iterator();\r\n      while(itr.hasNext()) {\r\n         Object element = itr.next();\r\n         System.out.print(element + \" \");\r\n      }\r\n      ListIterator litr = al.listIterator();\r\n      while(litr.hasNext()) {\r\n         Object element = litr.next();\r\n         litr.set(element + \"+\");\r\n      }\r\n      System.out.print(\"\\nModified contents of al: \");\r\n      itr = al.iterator();\r\n      while(itr.hasNext()) {\r\n         Object element = itr.next();\r\n         System.out.print(element + \" \");\r\n      }\r\n      System.out.print(\"\\nModified list backwards: \");  \r\n      while(litr.hasPrevious()) {\r\n         Object element = litr.previous();\r\n         System.out.print(element + \" \");\r\n      }\r\n   }\r\n}\r\n<\/pre>\n<p><strong>The output of the above code:<\/strong><\/p>\n<div class=\"code-output\">Original contents of al: D A T A F L A I R<br \/>\nModified contents of al: D+ A+ T+ A+ F+ L+ A+ I+ R+<br \/>\nModified list backwards: R+ I+ A+ L+ F+ A+ T+ A+ D+<\/div>\n<h3>Java Comparator Interface in Collection Framework<\/h3>\n<p>The comparator interface gives us the provision to compare two instances of a class or two elements in a collection of data. Hence, the Comparator interface consists of two methods: the compare method and the equals method.<\/p>\n<p>However, the Comparator Interface in Java enables developers to define the mechanism to sort the elements according to the requirement. However, the comparator interface then compares the values that are defined in the interface. Although, this interface is present in the java.util package.<\/p>\n<h4>The compare method in Java:<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">int compare(Object obj1, Object obj2)\r\n<\/pre>\n<p><strong>The compare method returns:<\/strong><\/p>\n<ul>\n<li>negative if obj1 &lt; obj2<\/li>\n<li>zero if obj1 == obj2<\/li>\n<li>positive if obj1 &gt; obj2<\/li>\n<\/ul>\n<h4>The equal method in Java:<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">boolean equals(Object obj)\r\n<\/pre>\n<p>Hence, the equal() method returns true if the equality satisfies the object.<\/p>\n<p><strong>Code to understand comparator implementation in Java:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">package com.DataFlair.CollectionFramework;\r\nimport java.util.*;\r\nclass Dog implements Comparator&lt;Dog&gt;, Comparable&lt;Dog&gt; \r\n  {\r\n   private String name;\r\n   private int age;\r\n   Dog() {\r\n   }\r\n   Dog(String n, int a) {\r\n      name = n;\r\n      age = a;\r\n   }\r\n   public String getName() {\r\n      return name;\r\n   }\r\n   public int getAge() {\r\n      return age;\r\n   }\r\n   public int compareTo(Dog d) {\r\n      return (this.name).compareTo(d.name);\r\n   }\r\n   public int compare(Dog d, Dog d1) {\r\n      return d.age - d1.age;\r\n   }\r\n}\r\npublic class Example {\r\n   public static void main(String args[]) \r\n   {\r\n     List&lt;Dog&gt; list = new ArrayList&lt;Dog&gt;();\r\n     list.add(new Dog(\"Scooby\", 3));\r\n     list.add(new Dog(\"Bruno\", 2));\r\n     list.add(new Dog(\"Oreo\", 10));\r\n     list.add(new Dog(\"Darcy\", 4));\r\n     list.add(new Dog(\"Tommy\", 1));\r\n     Collections.sort(list);\r\n     for(Dog a: list)\r\n         System.out.print(a.getName() + \", \");\r\n     Collections.sort(list, new Dog());\r\n     System.out.println(\" \");\r\n     for(Dog a: list) \r\n         System.out.print(a.getName() +\"  : \"+ a.getAge() + \", \");\r\n   }\r\n}\r\n<\/pre>\n<p><strong>The output of the above code:<\/strong><\/p>\n<div class=\"code-output\">Bruno, Darcy, Oreo, Scooby, Tommy,<br \/>\nTommy : 1, Bruno : 2, Scooby : 3, Darcy : 4, Oreo : 10,<\/div>\n<h3>Advantages of Java Collection Framework<\/h3>\n<p>The Java Collection framework has several advantages, a few of which include:<\/p>\n<p><strong>1. Consistent API:<\/strong> Java collection framework consists of a consistent API that has all the essential arrangements of interfaces like collections, Lists, Set, List, etc, and classes that implement the interfaces like ArrayList, Vector, etc.<\/p>\n<p><strong>2. Reduce Programming Exertion:<\/strong> The collection framework provides various provisions to implement an operation with ease, as a result, which helps the programmer to focus on the main task, rather than the basic operations.<\/p>\n<p><strong>3. Increases Program Quality and Speed:<\/strong> The collection Framework helps to increase the execution speed and quality by reducing program size and letting the programmer handle data with ease.<\/p>\n<h3>Choosing the Right Collection in Java<\/h3>\n<p>Picking the appropriate collection for your data structure is a vital step in working with the Java Collection Framework. Although there are some additional factors to consider when making your choice:<\/p>\n<p><strong>1. Thread Safety:<\/strong> If your program involves multiple threads working with the same collection concurrently, you&#8217;ll need to consider thread safety. However, the Java Collection Framework offers thread-safe versions of some collection classes, such as ConcurrentHashMap and CopyOnWriteArrayList. Therefore, these classes ensure that data modifications by one thread won&#8217;t corrupt operations by another thread.<\/p>\n<p><strong>2. Iteration Needs:<\/strong> How you plan to iterate over your collection can also influence your decision. For example, if you need random access to elements, an ArrayList might be suitable. But if you only need to iterate in the order in which elements were added, a LinkedList could be more efficient.<\/p>\n<h3>Conclusion<\/h3>\n<p>No doubt that the Java Collection Framework makes the programmer\u2019s task simpler. Not just that, by reducing the hassles of writing the operations manually, the Java framework enables programmers to solve bigger problems with ease. Therefore, this is the reason why the Java collection framework is so important. In this article, we saw the basic structure of the Java collection framework, as well as how to implement a few of the important methods.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the day-to-day life of a programmer, we are required to maintain a given set of data. Therefore, Java has different collections like lists, stacks, queues, etc., to maintain this set of data. However,&#46;&#46;&#46;<\/p>\n","protected":false},"author":5,"featured_media":108835,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32],"tags":[2634,2635,5638,7428,7589,7752],"class_list":["post-11882","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java","tag-collection-in-java-with-examples","tag-collections-framework-in-java","tag-hierarchy-of-collection-framework-in-java","tag-java-collection-classes","tag-java-map-interface","tag-java-util-map"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Collection Framework in Java - Hierarchy, Need &amp; Advantages - DataFlair<\/title>\n<meta name=\"description\" content=\"Java Collection Framework tutorial- Collections in Java, Advantage of collection framework in Java, its Need, composition and Hierarchy\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/collection-framework-in-java\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Collection Framework in Java - Hierarchy, Need &amp; Advantages - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Java Collection Framework tutorial- Collections in Java, Advantage of collection framework in Java, its Need, composition and Hierarchy\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/collection-framework-in-java\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2018-03-27T08:46:29+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-05-22T10:53:01+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Collection-Framework-in-Java.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"13 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Collection Framework in Java - Hierarchy, Need &amp; Advantages - DataFlair","description":"Java Collection Framework tutorial- Collections in Java, Advantage of collection framework in Java, its Need, composition and Hierarchy","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/data-flair.training\/blogs\/collection-framework-in-java\/","og_locale":"en_US","og_type":"article","og_title":"Collection Framework in Java - Hierarchy, Need &amp; Advantages - DataFlair","og_description":"Java Collection Framework tutorial- Collections in Java, Advantage of collection framework in Java, its Need, composition and Hierarchy","og_url":"https:\/\/data-flair.training\/blogs\/collection-framework-in-java\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2018-03-27T08:46:29+00:00","article_modified_time":"2026-05-22T10:53:01+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Collection-Framework-in-Java.jpg","type":"image\/jpeg"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"13 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/collection-framework-in-java\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/collection-framework-in-java\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/7f83c342f5d1632d6f7b4b0b0f447823"},"headline":"Collection Framework in Java &#8211; Hierarchy, Need &amp; Advantages","datePublished":"2018-03-27T08:46:29+00:00","dateModified":"2026-05-22T10:53:01+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/collection-framework-in-java\/"},"wordCount":2671,"commentCount":3,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/collection-framework-in-java\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Collection-Framework-in-Java.jpg","keywords":["Collection in java with examples","Collections Framework in Java","Hierarchy of Collection Framework in Java","Java collection classes","Java Map interface","java.util.Map"],"articleSection":["Java Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/collection-framework-in-java\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/collection-framework-in-java\/","url":"https:\/\/data-flair.training\/blogs\/collection-framework-in-java\/","name":"Collection Framework in Java - Hierarchy, Need &amp; Advantages - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/collection-framework-in-java\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/collection-framework-in-java\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Collection-Framework-in-Java.jpg","datePublished":"2018-03-27T08:46:29+00:00","dateModified":"2026-05-22T10:53:01+00:00","description":"Java Collection Framework tutorial- Collections in Java, Advantage of collection framework in Java, its Need, composition and Hierarchy","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/collection-framework-in-java\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/collection-framework-in-java\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/collection-framework-in-java\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Collection-Framework-in-Java.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2018\/03\/Collection-Framework-in-Java.jpg","width":1200,"height":628,"caption":"Collection Framework in Java"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/collection-framework-in-java\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"Java Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/java\/"},{"@type":"ListItem","position":3,"name":"Collection Framework in Java &#8211; Hierarchy, Need &amp; Advantages"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/7f83c342f5d1632d6f7b4b0b0f447823","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"DataFlair Team creates expert-level guides on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our goal is to empower learners with easy-to-understand content. Explore our resources for career growth and practical learning.","url":"https:\/\/data-flair.training\/blogs\/author\/dfteam1\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/11882","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=11882"}],"version-history":[{"count":14,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/11882\/revisions"}],"predecessor-version":[{"id":148398,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/11882\/revisions\/148398"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/108835"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=11882"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=11882"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=11882"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}