• 19 June

    Difference between Abstract Class and Interface in java

    Some of the popular interview questions are “What are differences between abstract class and interface“. “When will you use abstract class and when will you use interface“. So in this article ,we will go through this topic. Before going through differences between them, Lets go through its introduction. Abstract class Abstract classes are created to […]

  • 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-66065b282b3f8352722293/] 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 […]

  • 25 February

    hash and indexFor method in HashMap

    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 to iterate over HashMap Target AudienceThis post is for the people who already have […]

  • 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 […]

  • 08 December

    Static keyword in java with examples

    In this post, we will see about static keyword in java.So static keyword can be associated with: Variable Method Block Nested class Lets go through each one by one. Static variable: If any instance variable is declared as static.It is known as static variable. [crayon-66065b2850534677068156/] Some points about static variables are: Static variable belongs to […]