Friday, 3 July 2015

Custom Java HashMap - Internal Working

HashMap is a Collection class in Java that stores objects with the help of hascode and equals. It is said to be faster in retrieving objects.
Lets create a custom implementation of HashMap  and understand how it works. To understand HashMap you need to first understand Singly and DoublyLinkedList.

HashMap stores objects in form of Key and Value. A value can be fetched by passing the Key.

HashMap stores objects into different buckets(LinkedList). The object with same hashcode are stored in same LinkedList. Remember that the objects are stored in key-value pairs. The hashcode of key is used and not the hashcode of value. Only Key alone is required to put and get the object. Value is just a object placed against the key, So depending upon how many objects(Keys) are present with different hashcodes, that many LinkedList gets created.

Tuesday, 2 June 2015

Symmetric Key Encryption between JAVA and IOS

There has been a exponential increase in REST services implementation between IOS/Android devices and Java Middleware, This has become the solution architecture for most applications which provide support on IOS/Android devices and also provide interface on web using java web application.



To make the communication secure it is necessary that this REST messages are made secure. This can be achieved using symmetric encryption mechanism.


Node JS Express Mongo

This blog will help you to create a NodeJS application with the help of express, jade and mongo DB


1. Install Node JS
Go to link http://nodejs.org/ and click the Install button. It will identify your workstations operating system and start download an msi file.
After the file is downloaded install it at you preferred location.


Monday, 1 June 2015

Java Singleton Pattern

Singleton pattern is the most common types of patterns used in Java. It is also very common that interviewers ask questions to explain and implement singleton pattern

Lets first define Singleton
Singleton is a class whose only one object can be created.
There are couple of ways to implement Singleton class. Lets see the simplest one first.

Share the post