Monthly Archives: August 2016

Different way to iterate List in Java

Oracle Java
There are different way of traversal of ListArrayList, Vector object in java for getting its values. In day-to-day life, we almost use List with different flavor of created object like AraryList, Vector, LinkedList on every alternate day in java programming language, but way of iteration is different , its depend upon the requirement and the required thing in mind on that point of time.

Continue reading Different way to iterate List in Java

How to remove Entry from HashMap in Java

Oracle Java
Well, sometimes interviewer asked you , how to remove any Entry/record from Map, or its implementation class HashMap, Hashtable, LinkedHashMap or ConcurrentHashMap. In day-to-day development you can found the situation where you have to remove from Map best on the matching of key or value. So you can use the following way in your real life project. I prefer , if you don’t know how to iterate HashMap in java , first go through prior post to understand how to iterate over HashMap.
Continue reading How to remove Entry from HashMap in Java

Different way to iterate Map in Java

Oracle Java
There are different way of traversal of Map HashMap , ConcurrentHashMap object in java for getting key/value pair . In day-to-day life, we almost use Map (either get or put operation) on every alternate day in java programming language. But way of iteration is different , its depend upon the requirement and thing in mind on that point of time. Most of the time while iteration we don’t know the key and its value. we have to iterate over and best on that we usually process.
Continue reading Different way to iterate Map in Java

Design Pattern : Adapter Versus Bridge

These two design pattern, i.e. Adapter and Bridge looks similar somewhere but intent of both are different. Here, first letter of both describe about their pattern. Well, be logical and you can link logically/illogically to remember things most of the time , specially if you want to learn for longer period of time :). In Bridge pattern , first letter is ‘B’ means Before design, this pattern which considerable at design time. In Adapter first letter is A means After , it means after design it can be considered. These B and A letter is used here just to keep in mind or you can say learning purpose. Let me explain the similarity and differences between them.
Continue reading Design Pattern : Adapter Versus Bridge