ArrayList – orderd, fast iteration and fast random access.LinkedList – orderd,fast insertion and deletionHashSet – unsorted, unordered Set. no duplicates and you don’t care about order.LinkedHashSet– orderd, Use this class instead of HashSet when you care about the iteration order.TreeSet– Sorted.HashMap– unsorted, unordered. don’t care about the order.LinkedHashMap– maintains insertion order (or, optionally, access order).Continue reading “How to decide usage of Java Collections ???”
Category Archives: Design Patterns
Singleton Design Pattern in a clustered Environment !!!
When to Use: We can use Singleton pattern while creating objects of thread pools, caches etc to avoid wasting resources. If you want to store global information like item price of products etc. It’s now a anti-pattern and you should avoid it by different substitutes. Important Note: It has now become Anti-design pattern and weContinue reading “Singleton Design Pattern in a clustered Environment !!!”