Skip to main content

Posts

Showing posts from May, 2017

What is a java HashMap and How it works ?

What is a java HashMap and How it works ? What is a HashMap ?             The HashMap in Java is one of the most popular Collection class among Java programmers. The HashMap is a data structure, based on hashing, which allows you to store an object as key value pair, an advantage of using HashMap is that you can retrieve object on constant time i.e. O(1) if you know the key. The HashMap class implements Map interface and supports Generics from Java 1.5 release, which makes it type safe. There are a couple of more Collections, which provides similar functionalities like HashMap, which can also be used to store key value pair. Hashtable is one of them, but Hashtable is synchronized and performs poorly in a single threaded environment. one relatively new is ConcurrentHashMap, which provides better performance than Hashtable in a concurrent environment and should be preferred. How HashMap works ?             In Hashmap objects are stored by calling   put(key, value)   method o

An Introduction to Spring Framework

An Introduction to Spring Framework   What is Spring ? Spring is an application framework . Unlike single-tier frameworks such as Struts or Hibernate, Spring aims to help structure whole applications in a consistent, productive manner, pulling together best-of-breed single-tier frameworks to create a coherent architecture. Why Spring ? The Spring Framework is an open source application framework that aims to make J2EE development easier. We’ll look at the motivation for Spring, its goals, and how Spring can help you develop high-quality applications quickly. Using J2EE “out of the box” is not an attractive option. Many J2EE APIs and services are cumbersome to use. J2EE does a great job of standardizing low-level infrastructure, solving such problems as how can Java code access transaction management without dealing with the details of transactions. But J2EE does not provide an easily usable view for application code.That is the role of an application framework, such a