Constructor Chain

As we all know that Constructor in java always executes when we create an object. But what is the order of execution of constructors when we have parent child relationship ? Always constructor’s default first statement is super(); which means it calls super class constructor. Let’s see it with an example Example1.java package com.kb.constructorchain;   […]

Share this article on

Access Modifiers

Access Modifiers : Specifies the accessibility of members of a class (attributes /methods/constructors) based on the access modifier we can restrict the member’s accessibility, we can decide where and all these members can be accessible to use it. Java provides 4 types of Access Modifiers 1) private 2) default 3) protected 4) public Non Access […]

Share this article on
Next >