• 18 June

    Comparable in java

    In this post, we will see  how you can use comparable to sort list of objects in java. Comparable interface: Class whose objects to be sorted must implement this interface.In this,we have to implement compareTo(Object) method. For example: [crayon-66220ba019d2a242675061/] If any class implements comparable inteface then collection of that object can be sorted automatically using […]

  • 17 June

    Method overloading in java

    If two or more methods have same name , but different argument then it is called method overloading. Why you would do that (same name but different argument)? Lets take an example. You want to print salary of employee and sometimes company gives bonus to their employee and sometimes it don’t.So If company don’t give […]

  • 17 June

    Comparator in java

    In this post, we will see how you can use comparator to sort list of objects in java. Comparator: When you want to sort the list of objects of a class,you can use Comparator interface. You don’t need to implement Comparator on the class whose objects need to be sorted. You can create a separate […]

  • 17 June

    Method overriding in java

    If subclass is having same method as base class then it is known as method overriding Or in another words, If subclass provides specific implementation to any method which is present in its one of parents classes then it is known as method overriding Lets start with a real time example: In a small organization,There […]

  • 26 February

    Externalizable in java

    This is 3rd part of java Serialization tutorial Java Serialization Tutorial: Serialization in java Java Serialization interview questions and answers serialversionuid in java serializationexternalizable in java Transient keyword in java Difference between Serializable and Externalizable in Java Before understanding Externalizable interface, you need to have idea about Serialization.You can read more about Serialization at Serialization […]

  • 24 February

    hashcode() and equals() method in java

    In this post ,we will try to understand hashcode() and equals() method in java. 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 Difference between HashMap and HashSet Difference between HashMap and Hashtable How […]

  • 11 March

    serialVersionUID in java Serialization

    This is 2nd part of java Serialization tutorial Java Serialization Tutorial: Serialization in java Java Serialization interview questions and answers serialversionuid in java serialization externalizable in java Transient keyword in java Difference between Serializable and Externalizable in Java serialVersionUID is used to ensure that same class(That was used during Serialization) is loaded during Deserialization.serialVersionUID is […]

  • 09 March

    Serialization in java

    This is 1st part of java Serialization tutorial. Java Serialization Tutorial: Serialization in java Java Serialization interview questions and answers serialversionuid in java serializationexternalizable in java Transient keyword in java Difference between Serializable and Externalizable in Java Java provides mechanism called serialization to persists java objects in a form of ordered or sequence of bytes […]

  • 01 March

    Template method design pattern in java

    CodeProjectTemplate method pattern is a behavioral design pattern which provide base method for algorithm,called template method which defers some of its steps to subclasses So algorithm structure is same but some of its steps can be redefined by subclasses according to context. Template means Preset format like HTML templates which has fixed preset format.Similarly in […]