• 28 July

    Inheritance in Java

    In this post, we will see about Inheritance in java. It is one of the OOPs principles apart from Abstraction, encapsulation and polymorphism. Introduction The word Inheritance is quite familiar with everyone. In common terms, the word means the bequeathing of property and characteristics from generation to generation. For example, the property or characteristics of […]

  • 27 May

    Polymorphism in java with example

    In this tutorial, we will see about Polymorphism in java. Polymorphism in java is one of core Object oriented programming concepts with Abstraction, encapsulation, and inheritance. Polymorphism means one name many forms. In Java, polymorphism can be achieved by method overloading and method overriding. There are two types of polymorphism in java. Compile time polymorphism. Run […]

  • 02 May

    Encapsulation in java with example

    Encapsulation in java is the process of binding related data(variables) and functionality(methods) into a single unit called class. Encapsulation can be achieved by using access modifier such as public, private, protected or default, so your class will be safe from unauthorized access by others and will be simple to maintain. We can create fully encapsulated […]

  • 27 April

    Abstraction in java

    In this post, we will see about Abstraction in java. Introduction Abstraction is a concept of exposing only essential details and hiding implementation details. It is one of the essential OOPs concept apart from encapsulation, inheritance and polymorphism. Abstraction retains only information which is most relevant for the specific purpose. For example: ArrayList stores objects […]

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

  • 27 April

    Interface in java

    In previous post, we have seen abstract class in java which provides partial abstraction. Interface is one of the core part of java and is used to achieve full abstraction. Interface is generally used to provide contract for class to implement. Interface do not have implementation of any method.A class implements an interface, thereby inheriting […]

  • 26 August

    Copy Constructor in java

    In this post, we will see about copy constructor in java. Copy constructor is the constructor which takes parameter as object of same class and copy each field of the class to the new object. Unlike C++, java does not provide default copy contructor. You need to create one, if you want to have copy […]

  • 26 August

    Java default constructor

    In this post, we will see about Java default constructor. Default constructor is the no arg constructor which is inserted by compiler unless you provide any other constructor explicitly. You won’t able to see it as it is present in class file rather than source file. Is there any difference between no argument constructor and […]

  • 28 May

    Constructor in java

    Constructor in java is block of code which allows you to create instance of the object. It does not have return type. It has two main points Constructor name should be same as class Constructor should not have any return type else it will be same as method. There are three types of Constructor in Java. […]