The Interface and Class Hierarchy Diagram of Java Collections
1. Collection vs Collections
First of all, "Collection" and "Collections" are two different concepts. As you will see from the hierarchy diagram below, "Collection" is a root interface in the Collection hierarchy but "Collections" is a class which provide static methods to manipulate on some Collection types.
2. Class hierarchy of Collection
The following diagram demonstrates class hierarchy of Collection.
3. Class hierarchy of Map
Here is class hierarchy of Map.
4. Summary of classes
5. Code Example
The following is a simple example to illustrate some collection types:
List<String> a1 = new ArrayList<String>(); a1.add("Program"); a1.add("Creek"); a1.add("Java"); a1.add("Java"); System.out.println("ArrayList Elements"); System.out.print("\t" + a1 + "\n"); List<String> l1 = new LinkedList<String>(); l1.add("Program"); l1.add("Creek"); l1.add("Java"); l1.add("Java"); System.out.println("LinkedList Elements"); System.out.print("\t" + l1 + "\n"); Set<String> s1 = new HashSet<String>(); // or new TreeSet() will order the elements; s1.add("Program"); s1.add("Creek"); s1.add("Java"); s1.add("Java"); s1.add("tutorial"); System.out.println("Set Elements"); System.out.print("\t" + s1 + "\n"); Map<String, String> m1 = new HashMap<String, String>(); // or new TreeMap() will order based on keys m1.put("Windows", "2000"); m1.put("Windows", "XP"); m1.put("Language", "Java"); m1.put("Website", "programcreek.com"); System.out.println("Map Elements"); System.out.print("\t" + m1); |
Output:
ArrayList Elements [Program, Creek, Java, Java] LinkedList Elements [Program, Creek, Java, Java] Set Elements [tutorial, Creek, Program, Java] Map Elements {Windows=XP, Website=programcreek.com, Language=Java}
<pre><code> String foo = "bar"; </code></pre>
Pingback: EcoMax Fuel Saver Review()
Pingback: สล็อตวอเลทเว็บตรง()
Pingback: company website()
Pingback: Garment Conveyor For Sale()
Pingback: Blaux Heater 450w()
Pingback: Lifetime Keto ACV Gummies Review()
Pingback: bitcoin-360-ai72592.blogofchange.com()
Pingback: teeth Whitening()
Pingback: Going Here()
Pingback: redirect to sprayfoambeaufortcounty.com()
Pingback: เกมสล็อต pg()
Pingback: Stop Toothache()
Pingback: Teeth whitening Reviews()
Pingback: Neural Keto Gummies Ingredients()
Pingback: nha khoa việt smile trả góp()
Pingback: https://Vietq.Vn/tra-hoa-qua-co-the-gay-hai-cho-rang-d139234.html()
Pingback: Nha khoa việT smile hà đông()
Pingback: https://liverpoolsu.com()
Pingback: dental implant()
Pingback: anchor()
Pingback: https://www.scoop.it()
Pingback: Children's Teeth()
Pingback: Netcallvoip.com()
Pingback: Khoanhkhacvietnam.vn()
Pingback: Spurthy.in published an article()
Pingback: nha khoa ViệT smile Hai bà trưng()
Pingback: Solar In Orlando()
Pingback: bookingcare.vn()
Pingback: teeth need sealants()
Pingback: small acts()
Pingback: Whitening procedure()
Pingback: st louis dentists()
Pingback: Restorative Dentistry()
Pingback: nha khoa việt smile phốt()
Pingback: Military Care()
Pingback: Sedation dentist New york()
Pingback: ارسال انبوه پیوی واتساپ flw1()
Pingback: ambbet()
Pingback: https://pgslotx.org()
Pingback: XOSLOTZ ฝากไม่มีขั่นต่ำ slotxo ทรูวอเลท()
Pingback: right wall color()
Pingback: Dental Plymouth mn()
Pingback: Dental treatment()
Pingback: pc repair place refused to return my laptop and threatened to "come after" me and sue me if i left them a negative review.()
Pingback: danluat.thuvienphapluat.vn()
Pingback: nha khoa Vietsmile trả góp()
Pingback: https://globalcastingresources.com/nhung-cau-tha-thinh-hay-danh-cho-hoi-e-lau-nam/()
Pingback: รวม เกมส์ สล็อต ทุก ค่าย()
Pingback: สล็อต เว็บตรง()
Pingback: เว็บ เกม ออนไลน์ ตรง()
Pingback: ดูหนังออนไลน์ 4k()
Pingback: Marianne Beaty()
Pingback: Www.Atlasassistans.Net()
Pingback: https://twicsy.com/fr/acheter-instagram-likes()
Pingback: https://twicsy.com/pt/comprar-seguidores-instagram()
Pingback: https://twicsy.com/uk()
Pingback: allbet()
Pingback: camera repairs birmingham()
Pingback: Https://Bookmarksiteslist.Com()
Pingback: iphone()
Pingback: Nu Spectra CBD Reviews()
Pingback: Peak Canna CBD Gummies Review()
Pingback: Los Angeles Lakers JERSEYS,los angeles lakers jersey men,los angeles lakers city jersey()
Pingback: мешки упаковочные полиэтиленовые()
Pingback: new Dental implants()
Pingback: astutamme saamarin()
Pingback: wulffsmed8860.livejournal.com()
Pingback: marijuanalle lyön()
Pingback: Xtreme Keto Lean()
Pingback: quesnit.in()
Pingback: Web3 Gaming()
Pingback: employee login portals()
Pingback: mom()
Pingback: Pure Thrive Skin Serum Review()
Pingback: my company()
Pingback: https://Firstfeudal.harpoon.games/wiki/En/Choosing_A_Medicare_And_Medicaid_Doctor()
Pingback: free games()
Pingback: Dental marketing consultant()
Pingback: planet Earth()
Pingback: irishheritagefestival.com()
Pingback: Https://Threadocelot88.Edublogs.Org/2022/08/28/The-Hallmarks-Of-The-Double-Chin-Exercises/()
Pingback: http://bhtpa.dongnai.Gov.vn/lists/hiscounter/Dispform.aspx?id=123248()
Pingback: DIY TOYS Wholesalers()
Pingback: 1хбет скачать()
Pingback: Diamondengagementring published an article()
Pingback: blocked drains worcester park()
Pingback: Mexico dental implants()
Pingback: nha khoa việt smile review()
Pingback: tooth implant bridge()
Pingback: altcoins that will explode()
Pingback: similar webpage()
Pingback: situs slot online gacor()
Pingback: dental clinic washington Dc()
Pingback: missing Tooth crowned()
Pingback: Read Even more()
Pingback: brisbane cosmetic Dentist()
Pingback: 債務重組邊間好()
Pingback: baby Teething toys()
Pingback: yourlisten.com()
Pingback: Sweetdate.Space()
Pingback: Treat Baby()
Pingback: https://www.pctopapp.com/search/label/Messenger()
Pingback: artnames.info()
Pingback: sbobet88()
Pingback: 8张图理解Java-小林博客()
Pingback: 鐤鐙侸ava瀛︿範绗旇帮紙60锛———-8寮犲浘鐞嗚ВJava | 程序员之家()
Pingback: 8张图理解Java - 一叶网()
Pingback: 8张图理解Java - OkayWit()
Pingback: 8张图理解Java 丨 Who am I ?()
Pingback: fishnut.ca()
Pingback: Youth Fringe | 8张图理解Java()
Pingback: 8张图理解Java | 余哥技术博客()
Pingback: 8张图理解Java | haleywang()
Pingback: IT-Homer 博客 » 8张图理解Java()
Pingback: 8张图理解Java – Android开发中文站()
Pingback: 免费Simple Java (非常简单的英文) - IT新闻()
Pingback: Java in Diagram #java | A Listly List()
Pingback: 2013年图说Java —— 理解Java机制最受欢迎的8幅图 - 编程 - 开发者()
Pingback: 图说Java « 优大网()
Pingback: Top 10 questions for Java Collections | Kosovo Java Programmers()
Pingback: 8 张图助你更好地理解 Java 编程 | 扬智IT实验室()
Pingback: 8 张图助你更好地理解Java | 小样儿(ShowYounger)()