In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 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 collection method of Java development". In the operation of actual cases, many people will encounter such a dilemma, so 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!
The most commonly used collection classes are List and Map. Specific implementations of List include ArrayList and Vector, which are variable-sized lists that are suitable for building, storing, and manipulating element lists of any type of object. List is suitable for accessing elements by numeric index.
Map provides a more general method of storing elements. The Map collection class is used to store element pairs (called "keys" and "values"), where each key maps to a value.
ArrayList/Vector
Collection
HashSet/TreeSetSet
PropetiesHashTable
Map
Treemap/HashMap
What I remember is not the method name, but the thought, I know that they all have the method of adding, deleting, changing and checking, but the specific name of these methods, I do not remember very clearly, for set, the approximate method is add,remove, contains; for map, the approximate method is put,remove,contains, etc., because, as long as I press the point operator under eclispe, these methods come out naturally. Some of the ideas I remember is that the List class will have a method like get (int index) because it can fetch elements sequentially, while there is no method like get (int index) in the set class.
Both List and set can iterate through all the elements, and you need to get an iterator object first, so both the set and list classes have an iterator method that returns that iterator object. Map can return three sets, one is the collection of all key, the other is the collection of all valu, and the other is the collection of EntrySet objects composed of key and value. Map also has the get method, the parameter is key, and the return value is the value corresponding to key.
This is the end of the content of "what is the collection method developed by Java". 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.