• 18 February

    JAXB tutorial

    What is JAXB? JAXB stands for Java architecture for XML binding.It is used to convert XML to java object and java object to XML.JAXB defines an API for reading and writing Java objects to and from XML documents.Unlike SAX and DOM,we don’t need to be aware of XML parsing techniques. There are two operations you […]

  • 17 February

    Difference between ArrayList and Vector in java

    One of the common interview question is “What is difference between ArrayList and Vector”.Before we actually see differences,let me give you brief introduction of both. ArrayList ArrayList is implementation of list interface. ArrayList is not synchonized(so not thread safe) ArrayList is implemented using array as internal data structure.It can be dynamically resized . ArrayList increases […]

  • 17 February

    Difference between HashMap and HashSet in java

    One of the common interview question is “What is difference between HashMap and HashSet”..Before we actually see differences,let me give you brief introduction of both. Java HashMap: HashMap in java How HashMap works in java hash and indexfor method in HashMap hashcode and equals method in java How to sort HashMap by keys and values […]

  • 17 February

    Difference between Hashtable and HashMap in java

    One of the common interview questions is “What are differences between Hashtable and HashMap“.When I started using them, I used any of them irrespective of their differences.Afterward I found noticeable differences between them which can affect your performance of the application. .Before we actually see differences, let me give you a brief introduction of both. […]

  • 29 September

    Builder design pattern in java

    Builder design pattern allows to create complex object step by step and also enforces a process to create an object as a finished product.Construction of object should be such that same construction process can create different representations.Director controls the construction of object and only director knows what type of object to create. For example, You […]

  • 28 September

    Proxy design pattern in java

    CodeProjectProxy design pattern allows you to create a wrapper class over real object.Wrapper class which is proxy,controls access to real object so in turn you can add extra functionalities to real object without changing real object’s code. As described by GoF: “Provide a surrogate or placeholder for another object to control access over it.” Real […]

  • 19 September

    Composite design pattern in java

    CodeProjectComposite design patten allows you to have a tree structure and ask each node in the tree structure to perform a task.You can take real life example of a organization.It have general managers and under general managers, there can be managers and  under managers there can be developers.Now you can set a tree structure and […]

  • 19 September

    Adapter design pattern in java

    CodeProjectReal life example: A very simple example is using phone charger. Suppose your mobile phone needs 9 Volts of supply to get charged but main supply is 220 V which is not what you require but it can be a source and you can have something that can get 9 V out of this 220 […]

  • 19 September

    Bridge design pattern in java

    As stated by Gof: “Decouple an abstraction from its implementation so that the two can vary independently”.When there are inheritance hierarchies in both interface and implementation then you loose coupling because of interdependence.In other words,Decoupling interface from implementation and hiding implementation detail of abstraction from client is main objectives of bridge design pattern. Also known […]