Skip to main content

The collections in Java - Part 1

Hello friends,

Welcome back 🙂

In this article, I'm going to share about collections framework or simply collections in Java. I'll add collection's notes and articles in parts because its a large but important utility in Java development, so lets get start.

The collections - Basics

In this article, we'll just review the basics about collections. As the name suggest, collection framework is used to create collection of objects and that collection represents itself as a separate object. In the collection framework, Java provides several interfaces, classes i.e. implementation of interfaces and various common behaviors between those classes and interfaces.

Prior to collections, in Java, Vectors, Arrays and Hashtables were used for grouping Java objects. Here in this article, I'm just giving list of interfaces and classes of the collections framework:

Java provides two types of collections. One is list typed in which objects stored in a sequence manner or we can say something like simple array which doesn't having fixed size. Its base or root interface is Collection.

Another type is key-value pair typed collection in which every object in that collection must have a key or simply a mapping between an object which is known as key with another object which is known as value, the . I'll elaborate differences between those two types later, here I'll just add the list of interfaces and classes used in collections framework.

Interfaces:

  1. Collection 
  2. List
  3. Set
  4. SortedSet
  5. NavigableSet
  6. Queue
  7. Dequeue
  8. Map
  9. SortedMap
  10. NavigableMap

Classes: 

  1.  ArrayList
  2. LinkedList
  3. Stack
  4. Vector
  5. HashSet
  6. LinkedHashSet
  7. TreeSet
  8. PriorityQueue
  9. ArrayDequeue
  10. HashMap
  11. LinkedHashMap
  12. HashTable
  13. TreeMap

So that's all for today, I'll add its parts continuously. Also I'll add separate label as collections framework is a separate part to learn in Java.

Thanks.

Comments

Popular posts from this blog

Initialization blocks in Java

Hello friends, Welcome back. Today in this article, I'm going to explain you about the static block and initializer block. As the Java language is pure OOP language, whatever the code we write is only in classes. So whenever we use class to represent a real life entity, we use members in the class as the attributes or properties of that entity. To initialize those properties or members, we can use one of the way i.e. Constructor Setter method Inlinie Blocks I'm assuming that you are familiar with all methods. Here about first three methods, I'm just giving a short description. The first three methods are : we initialize member in constructor by using a parameterized constructor. Setter methods is a java standard which denotes that class's member should be private and it should have setter method so that the member can be initialized. Third method is inline i.e. when we declare a member or variable, at the same time, we set its value. In this article, we...

Recover messed up/lost UTF-8 characters in MySQL db

Hi friends, This was my first story on medium, now copying as it is on blogger. In this note, I’m going to explain you what are the messed up/lost/bad utf-8 characters and how to recover them to original in MySQL db. What is messed up/lost/bad utf-8 characters? The messed up or lost or bad characters are those characters which are normal if we convert it to UTF-8, but due to mistakes while import/export, that characters not display properly. Consider following example: Ã¥¾Ë†Ã¥¥½Ã§Å¡„产品。就是没货了 The above sentence is actually a Chinese sentence, but while import/export from db, it’s get messed up. How to recover them? To recover the messed up characters, we should convert them first into binary form, then convert that binary string to UTF-8 string, that’s it! To do this, use following SQL: In above SQL, we firstly converted data of varcharColto binary form using MySQL’s CAST function. Then converted that binary string to UTF-8 using CONVERT function. Aft...

XML tools on linux

Hello friends, Welcome back 🙂 In this article, we're going through XML tools which are useful for manipulation of XML. Recently I've worked on 3 tools so for now, adding those 3 tool's information, but as I get more, I'll update the article. These tools useful for validation and split/merge the XML. These tools available on both RHEL family and Debian family  linux which are same in use for both debian and RHEL. The tools are: 1. xmllint: This tool is used for xml validation. For some reason, we need to validate XML tags with its proper openings and closing i.e. syntactic validation, also we need to validate the data in the XML. The data can be different by its type which is defined in the XML's DTD, to detect this also, xmllint is useful. With this tool, there are multiple options we can use i.e. only syntactic validation, schema validation, DTD validation etc. When I was facing issue for validating the XML which having schema, I found this tool. H...