Share this post on:

Super Keyword in used for envoking parent class properties. Constructor of parent class not inheritate in subclass.

Here you we get an Example by which you can understand that how you can use Super keyword in Java.

Example:

Class A1
{
public A1()
{
System.out.println(“Hello A1”);
}
}
Class A2 extends A1
{
}
class A3 extends A2
{
public A3()
{
System.out.println(“Hello A3”);
}
public static void main(String[] srgs)
{
new A1();
new A2();
new A3();
}
}

Output:
Hello A1
Hello A1
Hello A1
Hello A3

Share this post on:
Avatar Raiyan

Author: Raiyan

Hi, I guess you're here because you want to know a bit about me. huh? I am not so good on talking about myself but I'll give a short about me.

My Name is Raiyan. I am a Professional Application Developer and a Blogger.
I started this website to Share my Knowledge. Here I provide all my knowledge whatever I earned till now.

One Comment

  1. Pingback: What are Important topics in java Interview? - ArzaTechs

Leave a Comment

Your email address will not be published. Required fields are marked *