{"id":155,"date":"2019-01-21T22:31:16","date_gmt":"2019-01-21T22:31:16","guid":{"rendered":"https:\/\/www.kindsonthegenius.com\/java\/?p=155"},"modified":"2020-08-06T09:54:41","modified_gmt":"2020-08-06T09:54:41","slug":"25-java-arraylist-and-linkedlist","status":"publish","type":"post","link":"https:\/\/www.kindsonthegenius.com\/java\/25-java-arraylist-and-linkedlist\/","title":{"rendered":"Java &#8211; ArrayList and LinkedList"},"content":{"rendered":"<p>I have decided to treat ArrayList and LinkedList together. This is because they are basically the same from the programmer&#8217;s view. So you use almost the same syntax for both. We would see this in a minute.<\/p>\n<p>Also note that ArrayList and LinkedList both inherites from the List class. So I would refer to both of them as just List.<\/p>\n<p>A list stores a sequence of elements which could be of the same or of different data types.<\/p>\n<p>&nbsp;<\/p>\n<p>You probably would want to know &#8216;<em>difference between ArrayList and Array<\/em>&#8216;. The main difference is that ArrayList support different data types while Array support just one data type.<\/p>\n<p><a href=\"https:\/\/www.kindsonthegenius.com\/java\/java-arrays\/\">Read about Arrays in Java Here<\/a><\/p>\n<p>&nbsp;<\/p>\n<h4><strong>Properties of Lists<\/strong><\/h4>\n<p>Take note of the following properties of a List. It applies both to ArrayList and LinkedList.<\/p>\n<ul>\n<li>You can reference element in a list using the index position of the element in the list. Indexes start from 0.<\/li>\n<li>Duplicate elements are allowed in a list.<\/li>\n<li>List provide several methods used to manipulate the elements<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h4><strong>ArrayList and LinkedList Methods<\/strong><\/h4>\n<p>So we have methods that apply to both ArrayList and LinkedList. This are given below.<\/p>\n<table class=\"table table-bordered\">\n<tbody>\n<tr>\n<th>SN<\/th>\n<th>Method brief description<\/th>\n<\/tr>\n<tr>\n<td class=\"ts\">1<\/td>\n<td><b>add(index, obj)<\/b><\/p>\n<p>Inserts an item into a list. The element is inserted at the index specified. Elements at the insertion point are shifted up. Therefore, no elements are overwritten.<\/td>\n<\/tr>\n<tr>\n<td class=\"ts\">2<\/td>\n<td><b>addAll(index, Collection c)<\/b><\/p>\n<p>Inserts all the elements of the collection\u00a0<b>c<\/b>\u00a0into the a list at the index passed in the index. Existing elements at or beyond the point of insertion are shifted. Therefore, no elements are overwritten. It returns true if the invoking list changes. It returns false if otherwise.<\/td>\n<\/tr>\n<tr>\n<td class=\"ts\">3<\/td>\n<td><b>get(int index)<\/b><\/p>\n<p>Returns the element stored at the given index.<\/td>\n<\/tr>\n<tr>\n<td class=\"ts\">4<\/td>\n<td><b>int indexOf(Object obj)<\/b><\/p>\n<p>It returns the index of the first instance of obj in a list. If the element, obj,is not an element of the list, then it returns 1<\/td>\n<\/tr>\n<tr>\n<td class=\"ts\">5<\/td>\n<td><b>int lastIndexOf(Object obj)<\/b><\/p>\n<p>Returns the index of the last instance\u00a0 of an element in a list. If the element, obj is not an element of the list, then it returns 1.<\/td>\n<\/tr>\n<tr>\n<td class=\"ts\">6<\/td>\n<td><b>ListIterator listIterator( )<\/b><\/p>\n<p>It returns an iterator to the start of the list.<\/td>\n<\/tr>\n<tr>\n<td class=\"ts\">7<\/td>\n<td><b>ListIterator listIterator(int index)<\/b><\/p>\n<p>Returns an iterator to the invoking list that begins at the specified index.<\/td>\n<\/tr>\n<tr>\n<td class=\"ts\">8<\/td>\n<td><b>remove(int index)<\/b><\/p>\n<p>It removes the element at the specified index from the list. It then returns the deleted element. The resulting list is then adjusted. Meaning that the indexes of subsequent elements are reduced by one.<\/td>\n<\/tr>\n<tr>\n<td class=\"ts\">9<\/td>\n<td><b>Object set(int index, Object obj)<\/b><\/p>\n<p>Assigns an element,\u00a0 obj to the location specified by index within the\u00a0 list.<\/td>\n<\/tr>\n<tr>\n<td class=\"ts\">10<\/td>\n<td><b>List subList(int start, int end)<\/b><\/p>\n<p>Returns a list that includes elements from specified start to end.1 in the a list. Elements in the returned sublist are also referenced by the calling object.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<h4>Lets&#8217; take and example<\/h4>\n<p>I recommend you try this yourself. The codes creates both an ArrayList and a LinkedList.<\/p>\n<p>&nbsp;<\/p>\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #008800; font-weight: bold;\">import<\/span> <span style=\"color: #0e84b5; font-weight: bold;\">java.util.ArrayList<\/span><span style=\"color: #333333;\">;<\/span>\r\n<span style=\"color: #008800; font-weight: bold;\">import<\/span> <span style=\"color: #0e84b5; font-weight: bold;\">java.util.LinkedList<\/span><span style=\"color: #333333;\">;<\/span>\r\n\r\n<span style=\"color: #888888;\">\/\/ ** Arrays, ArrayList and Linked List ***************<\/span>\r\n<span style=\"color: #008800; font-weight: bold;\">public<\/span> <span style=\"color: #008800; font-weight: bold;\">class<\/span> <span style=\"color: #bb0066; font-weight: bold;\">ListDemo<\/span> <span style=\"color: #333333;\">{<\/span>\r\n\r\n\t<span style=\"color: #008800; font-weight: bold;\">public<\/span> <span style=\"color: #008800; font-weight: bold;\">static<\/span> <span style=\"color: #333399; font-weight: bold;\">void<\/span> <span style=\"color: #0066bb; font-weight: bold;\">main<\/span><span style=\"color: #333333;\">(<\/span>String<span style=\"color: #333333;\">[]<\/span> args<span style=\"color: #333333;\">)<\/span> <span style=\"color: #333333;\">{<\/span>\r\n\t\t\r\n\t\tArrayList alist <span style=\"color: #333333;\">=<\/span> <span style=\"color: #008800; font-weight: bold;\">new<\/span> ArrayList<span style=\"color: #333333;\">();<\/span>\t\t\r\n\t\talist<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">add<\/span><span style=\"color: #333333;\">(<\/span><span style=\"background-color: #fff0f0;\">\"Osondu\"<\/span><span style=\"color: #333333;\">);<\/span>\r\n\t\talist<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">add<\/span><span style=\"color: #333333;\">(<\/span><span style=\"background-color: #fff0f0;\">\"Saffron\"<\/span><span style=\"color: #333333;\">);<\/span>\r\n\t\talist<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">add<\/span><span style=\"color: #333333;\">(<\/span><span style=\"background-color: #fff0f0;\">\"Oleander\"<\/span><span style=\"color: #333333;\">);<\/span>\r\n\t\talist<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">add<\/span><span style=\"color: #333333;\">(<\/span><span style=\"color: #6600ee; font-weight: bold;\">23.87<\/span><span style=\"color: #333333;\">);<\/span>\r\n\t\talist<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">add<\/span><span style=\"color: #333333;\">(<\/span><span style=\"color: #0044dd;\">'A'<\/span><span style=\"color: #333333;\">);<\/span>\r\n\t\tSystem<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">out<\/span><span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">println<\/span><span style=\"color: #333333;\">(<\/span><span style=\"background-color: #fff0f0;\">\"\\nElement of ArrayList: \"<\/span><span style=\"color: #333333;\">);<\/span>\r\n\t\tSystem<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">out<\/span><span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">println<\/span><span style=\"color: #333333;\">(<\/span><span style=\"background-color: #fff0f0;\">\"\\t\"<\/span> <span style=\"color: #333333;\">+<\/span> alist<span style=\"color: #333333;\">);<\/span>\r\n\t\t\r\n\t\tLinkedList llist <span style=\"color: #333333;\">=<\/span> <span style=\"color: #008800; font-weight: bold;\">new<\/span> LinkedList<span style=\"color: #333333;\">();<\/span>\t\t\r\n\t\tllist<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">add<\/span><span style=\"color: #333333;\">(<\/span><span style=\"background-color: #fff0f0;\">\"Osondu\"<\/span><span style=\"color: #333333;\">);<\/span>\r\n\t\tllist<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">add<\/span><span style=\"color: #333333;\">(<\/span><span style=\"background-color: #fff0f0;\">\"Saffron\"<\/span><span style=\"color: #333333;\">);<\/span>\r\n\t\tllist<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">add<\/span><span style=\"color: #333333;\">(<\/span><span style=\"background-color: #fff0f0;\">\"Oleander\"<\/span><span style=\"color: #333333;\">);<\/span>\r\n\t\tllist<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">add<\/span><span style=\"color: #333333;\">(<\/span><span style=\"color: #6600ee; font-weight: bold;\">23.87<\/span><span style=\"color: #333333;\">);<\/span>\r\n\t\tllist<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">add<\/span><span style=\"color: #333333;\">(<\/span><span style=\"color: #0044dd;\">'A'<\/span><span style=\"color: #333333;\">);<\/span>\r\n\t\tSystem<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">out<\/span><span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">println<\/span><span style=\"color: #333333;\">(<\/span><span style=\"background-color: #fff0f0;\">\"\\nElement of LinkedList: \"<\/span><span style=\"color: #333333;\">);<\/span>\r\n\t\tSystem<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">out<\/span><span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">println<\/span><span style=\"color: #333333;\">(<\/span><span style=\"background-color: #fff0f0;\">\"\\t\"<\/span> <span style=\"color: #333333;\">+<\/span> llist<span style=\"color: #333333;\">);<\/span>\t\r\n\t<span style=\"color: #333333;\">}<\/span>\r\n<span style=\"color: #333333;\">}\r\n<\/span><\/pre>\n<p>Listing 1.0: Array List and LinkedList<\/p>\n<p>&nbsp;<\/p>\n<p>If you execute the code in Listing 1.0, then you will have the output below:<\/p>\n<p>&nbsp;<\/p>\n<p><!-- HTML generated using hilite.me --><\/p>\n<pre style=\"margin: 0; line-height: 125%;\">Element of <span style=\"color: #997700; font-weight: bold;\">ArrayList:<\/span> \r\n\t<span style=\"color: #333333;\">[<\/span>Osondu<span style=\"color: #333333;\">,<\/span> Saffron<span style=\"color: #333333;\">,<\/span> Oleander<span style=\"color: #333333;\">,<\/span> <span style=\"color: #6600ee; font-weight: bold;\">23.87<\/span><span style=\"color: #333333;\">,<\/span> A<span style=\"color: #333333;\">]<\/span>\r\n\r\nElement of <span style=\"color: #997700; font-weight: bold;\">LinkedList:<\/span> \r\n\t<span style=\"color: #333333;\">[<\/span>Osondu<span style=\"color: #333333;\">,<\/span> Saffron<span style=\"color: #333333;\">,<\/span> Oleander<span style=\"color: #333333;\">,<\/span> <span style=\"color: #6600ee; font-weight: bold;\">23.87<\/span><span style=\"color: #333333;\">,<\/span> A<span style=\"color: #333333;\">]<\/span>\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>You can therefore see that ArrayLists and LinkedList are very similar.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have decided to treat ArrayList and LinkedList together. This is because they are basically the same from the programmer&#8217;s view. So you use almost &hellip; <\/p>\n","protected":false},"author":395,"featured_media":156,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[2],"tags":[],"class_list":["post-155","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java-tutorial"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Java - ArrayList and LinkedList - Java Tutorials<\/title>\n<meta name=\"description\" content=\"In this lesson, you will learn about ArrayList and LinkedLists in Java. You will also learn about methods available in both classes.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.kindsonthegenius.com\/java\/25-java-arraylist-and-linkedlist\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Java - ArrayList and LinkedList - Java Tutorials\" \/>\n<meta property=\"og:description\" content=\"In this lesson, you will learn about ArrayList and LinkedLists in Java. You will also learn about methods available in both classes.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.kindsonthegenius.com\/java\/25-java-arraylist-and-linkedlist\/\" \/>\n<meta property=\"og:site_name\" content=\"Java Tutorials\" \/>\n<meta property=\"article:published_time\" content=\"2019-01-21T22:31:16+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-08-06T09:54:41+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.kindsonthegenius.com\/java\/wp-content\/uploads\/sites\/9\/2019\/01\/ArrayList-and-LinkedList.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"959\" \/>\n\t<meta property=\"og:image:height\" content=\"518\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"kindsonthegenius\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"kindsonthegenius\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/java\\\/25-java-arraylist-and-linkedlist\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/java\\\/25-java-arraylist-and-linkedlist\\\/\"},\"author\":{\"name\":\"kindsonthegenius\",\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/java\\\/#\\\/schema\\\/person\\\/63a68934672db675ff0cd80d066510c2\"},\"headline\":\"Java &#8211; ArrayList and LinkedList\",\"datePublished\":\"2019-01-21T22:31:16+00:00\",\"dateModified\":\"2020-08-06T09:54:41+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/java\\\/25-java-arraylist-and-linkedlist\\\/\"},\"wordCount\":527,\"commentCount\":1,\"image\":{\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/java\\\/25-java-arraylist-and-linkedlist\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/java\\\/wp-content\\\/uploads\\\/sites\\\/9\\\/2019\\\/01\\\/ArrayList-and-LinkedList.jpg\",\"articleSection\":[\"Java Tutorial\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.kindsonthegenius.com\\\/java\\\/25-java-arraylist-and-linkedlist\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/java\\\/25-java-arraylist-and-linkedlist\\\/\",\"url\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/java\\\/25-java-arraylist-and-linkedlist\\\/\",\"name\":\"Java - ArrayList and LinkedList - Java Tutorials\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/java\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/java\\\/25-java-arraylist-and-linkedlist\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/java\\\/25-java-arraylist-and-linkedlist\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/java\\\/wp-content\\\/uploads\\\/sites\\\/9\\\/2019\\\/01\\\/ArrayList-and-LinkedList.jpg\",\"datePublished\":\"2019-01-21T22:31:16+00:00\",\"dateModified\":\"2020-08-06T09:54:41+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/java\\\/#\\\/schema\\\/person\\\/63a68934672db675ff0cd80d066510c2\"},\"description\":\"In this lesson, you will learn about ArrayList and LinkedLists in Java. You will also learn about methods available in both classes.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/java\\\/25-java-arraylist-and-linkedlist\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.kindsonthegenius.com\\\/java\\\/25-java-arraylist-and-linkedlist\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/java\\\/25-java-arraylist-and-linkedlist\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/java\\\/wp-content\\\/uploads\\\/sites\\\/9\\\/2019\\\/01\\\/ArrayList-and-LinkedList.jpg\",\"contentUrl\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/java\\\/wp-content\\\/uploads\\\/sites\\\/9\\\/2019\\\/01\\\/ArrayList-and-LinkedList.jpg\",\"width\":959,\"height\":518,\"caption\":\"ArrayList and LinkedList in Java\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/java\\\/25-java-arraylist-and-linkedlist\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/java\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java &#8211; ArrayList and LinkedList\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/java\\\/#website\",\"url\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/java\\\/\",\"name\":\"Java Tutorials\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/java\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/java\\\/#\\\/schema\\\/person\\\/63a68934672db675ff0cd80d066510c2\",\"name\":\"kindsonthegenius\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3079a7f663b02e801d03cd075852a037af36bd179b5fbcd0603bae3dd7833a9b?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3079a7f663b02e801d03cd075852a037af36bd179b5fbcd0603bae3dd7833a9b?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3079a7f663b02e801d03cd075852a037af36bd179b5fbcd0603bae3dd7833a9b?s=96&d=mm&r=g\",\"caption\":\"kindsonthegenius\"},\"url\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/java\\\/author\\\/kindsonthegenius-2\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Java - ArrayList and LinkedList - Java Tutorials","description":"In this lesson, you will learn about ArrayList and LinkedLists in Java. You will also learn about methods available in both classes.","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:\/\/www.kindsonthegenius.com\/java\/25-java-arraylist-and-linkedlist\/","og_locale":"en_US","og_type":"article","og_title":"Java - ArrayList and LinkedList - Java Tutorials","og_description":"In this lesson, you will learn about ArrayList and LinkedLists in Java. You will also learn about methods available in both classes.","og_url":"https:\/\/www.kindsonthegenius.com\/java\/25-java-arraylist-and-linkedlist\/","og_site_name":"Java Tutorials","article_published_time":"2019-01-21T22:31:16+00:00","article_modified_time":"2020-08-06T09:54:41+00:00","og_image":[{"width":959,"height":518,"url":"https:\/\/www.kindsonthegenius.com\/java\/wp-content\/uploads\/sites\/9\/2019\/01\/ArrayList-and-LinkedList.jpg","type":"image\/jpeg"}],"author":"kindsonthegenius","twitter_card":"summary_large_image","twitter_misc":{"Written by":"kindsonthegenius","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.kindsonthegenius.com\/java\/25-java-arraylist-and-linkedlist\/#article","isPartOf":{"@id":"https:\/\/www.kindsonthegenius.com\/java\/25-java-arraylist-and-linkedlist\/"},"author":{"name":"kindsonthegenius","@id":"https:\/\/www.kindsonthegenius.com\/java\/#\/schema\/person\/63a68934672db675ff0cd80d066510c2"},"headline":"Java &#8211; ArrayList and LinkedList","datePublished":"2019-01-21T22:31:16+00:00","dateModified":"2020-08-06T09:54:41+00:00","mainEntityOfPage":{"@id":"https:\/\/www.kindsonthegenius.com\/java\/25-java-arraylist-and-linkedlist\/"},"wordCount":527,"commentCount":1,"image":{"@id":"https:\/\/www.kindsonthegenius.com\/java\/25-java-arraylist-and-linkedlist\/#primaryimage"},"thumbnailUrl":"https:\/\/www.kindsonthegenius.com\/java\/wp-content\/uploads\/sites\/9\/2019\/01\/ArrayList-and-LinkedList.jpg","articleSection":["Java Tutorial"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.kindsonthegenius.com\/java\/25-java-arraylist-and-linkedlist\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.kindsonthegenius.com\/java\/25-java-arraylist-and-linkedlist\/","url":"https:\/\/www.kindsonthegenius.com\/java\/25-java-arraylist-and-linkedlist\/","name":"Java - ArrayList and LinkedList - Java Tutorials","isPartOf":{"@id":"https:\/\/www.kindsonthegenius.com\/java\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.kindsonthegenius.com\/java\/25-java-arraylist-and-linkedlist\/#primaryimage"},"image":{"@id":"https:\/\/www.kindsonthegenius.com\/java\/25-java-arraylist-and-linkedlist\/#primaryimage"},"thumbnailUrl":"https:\/\/www.kindsonthegenius.com\/java\/wp-content\/uploads\/sites\/9\/2019\/01\/ArrayList-and-LinkedList.jpg","datePublished":"2019-01-21T22:31:16+00:00","dateModified":"2020-08-06T09:54:41+00:00","author":{"@id":"https:\/\/www.kindsonthegenius.com\/java\/#\/schema\/person\/63a68934672db675ff0cd80d066510c2"},"description":"In this lesson, you will learn about ArrayList and LinkedLists in Java. You will also learn about methods available in both classes.","breadcrumb":{"@id":"https:\/\/www.kindsonthegenius.com\/java\/25-java-arraylist-and-linkedlist\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.kindsonthegenius.com\/java\/25-java-arraylist-and-linkedlist\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.kindsonthegenius.com\/java\/25-java-arraylist-and-linkedlist\/#primaryimage","url":"https:\/\/www.kindsonthegenius.com\/java\/wp-content\/uploads\/sites\/9\/2019\/01\/ArrayList-and-LinkedList.jpg","contentUrl":"https:\/\/www.kindsonthegenius.com\/java\/wp-content\/uploads\/sites\/9\/2019\/01\/ArrayList-and-LinkedList.jpg","width":959,"height":518,"caption":"ArrayList and LinkedList in Java"},{"@type":"BreadcrumbList","@id":"https:\/\/www.kindsonthegenius.com\/java\/25-java-arraylist-and-linkedlist\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.kindsonthegenius.com\/java\/"},{"@type":"ListItem","position":2,"name":"Java &#8211; ArrayList and LinkedList"}]},{"@type":"WebSite","@id":"https:\/\/www.kindsonthegenius.com\/java\/#website","url":"https:\/\/www.kindsonthegenius.com\/java\/","name":"Java Tutorials","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.kindsonthegenius.com\/java\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.kindsonthegenius.com\/java\/#\/schema\/person\/63a68934672db675ff0cd80d066510c2","name":"kindsonthegenius","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/3079a7f663b02e801d03cd075852a037af36bd179b5fbcd0603bae3dd7833a9b?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/3079a7f663b02e801d03cd075852a037af36bd179b5fbcd0603bae3dd7833a9b?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3079a7f663b02e801d03cd075852a037af36bd179b5fbcd0603bae3dd7833a9b?s=96&d=mm&r=g","caption":"kindsonthegenius"},"url":"https:\/\/www.kindsonthegenius.com\/java\/author\/kindsonthegenius-2\/"}]}},"_links":{"self":[{"href":"https:\/\/www.kindsonthegenius.com\/java\/wp-json\/wp\/v2\/posts\/155","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kindsonthegenius.com\/java\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kindsonthegenius.com\/java\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kindsonthegenius.com\/java\/wp-json\/wp\/v2\/users\/395"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kindsonthegenius.com\/java\/wp-json\/wp\/v2\/comments?post=155"}],"version-history":[{"count":2,"href":"https:\/\/www.kindsonthegenius.com\/java\/wp-json\/wp\/v2\/posts\/155\/revisions"}],"predecessor-version":[{"id":211,"href":"https:\/\/www.kindsonthegenius.com\/java\/wp-json\/wp\/v2\/posts\/155\/revisions\/211"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.kindsonthegenius.com\/java\/wp-json\/wp\/v2\/media\/156"}],"wp:attachment":[{"href":"https:\/\/www.kindsonthegenius.com\/java\/wp-json\/wp\/v2\/media?parent=155"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kindsonthegenius.com\/java\/wp-json\/wp\/v2\/categories?post=155"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kindsonthegenius.com\/java\/wp-json\/wp\/v2\/tags?post=155"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}