In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article introduces the relevant knowledge of "what is the principle of Java Linked list". In the operation of actual cases, many people will encounter such a dilemma. Then let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Definition: linkedlist belongs to the linked list structure, which is convenient to add and delete elements, but the query is not convenient, so it is suitable for the closing operation.
With a specific object, use the object to call the specific method
Add
/ / add element / / add element arr.add ("H") in the middle
AddFirst: add elements to the front of the collection
/ / add element arr.addFirst ("F") to the header of the linked list
AddLast: add elements to the end of the collection
/ / add the element arr.addLast ("L") to the end of the linked list
RemoveFirst removeLast: delete the first element, delete the last element
/ / Delete element arr.removeFirst ()
GetFirst getLast: get the first element, get the last element
/ / get the element String s1=arr.getLast ()
IsEmpty: used to determine whether there are elements in the collection. If so, false is returned.
Pop: pops elements from the collection from the stack
/ / when there is an element in arr, return False, use! Reverse while (! arr.isEmpty ()) {/ / pop the data in the array out of System.out.println ("this is the pop method" + arr.pop ());}
Push: add elements to the collection
/ / add new data arr.push ("xin") to the array
This is the end of the content of "what is the principle of Java Linked list". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.