8.11 What is Super Keyword in Java Part 1

preview_player
Показать описание
Java Programming/Keywords/super.

It is used inside a sub-class method definition to call a method defined in the super class.

Private methods of the super-class cannot be called.

Only public and protected methods can be called by the super keyword.
Super is a keyword used in java to refer the super class or base class.

If the method overrides one of its superclass's methods, overridden method can be

invoked

through the use of the keyword super. It can be also used to refer to a hidden field.

Check out our courses:

Coupon: TELUSKO10 (10% Discount)

Coupon: TELUSKO10 (10% Discount)

Coupon: TELUSKO20 (20% Discount)

Subscribe to the channel and learn Programming in easy way.

Рекомендации по теме
Комментарии
Автор

Superb sir nice explanation
.
.Total matter of this video is all about after 6 mins
.just scroll up to 6th minute to save the time

vamsireddy
Автор

this has to be one of the cleanest and most precise explanations on inheritance, thanks a lot Telusko, buddy you saved me a lot of trouble, thanks a

marvhartigan
Автор

Thanks a lot sir..You told the super concept in very lucid language

anups
Автор

Thank you so much this makes so much more sense than all the explanations I've looked at. A little less fear for java now. You are AWESOME.

manlinxu
Автор

I don't knw y those 42 people unlike this video😈.
What a man heads off.

zameelnm
Автор

Navin sir, considering the last example, where you pass an int value in the super(5) which is called in parameterized constructor of class B..Before that shouldn't there be a call to the default super(); ?

Should be like below while runtime:

super();
super(5);
syso();

and o/p as :
in Const A
in Const A para
in Const B para

raunakpatharkar
Автор

I wish I could use the super keyword in real life.

josephkreifelsii
Автор

Top class! Sir do you provide Java paid training course as well ?

rachitmongia
Автор

Sir, Can You Please Post The video on how to get Job as JAVA PROGRAMMER and what platform must need to understand.. What is knowledge important for entry level JAVA PROGRAMMER.. And what's will be expected ssalary.. so that can We prepare for interview and find that kind of job..

ashishgaikwad
Автор

In java, when we create object that particular class constructor will be invoked, then y that B() constructor and A() constructor didnot print on console?we have created objects for them but yet they have not instantiated and printed on console.why?

sabiyana
Автор

Hi Naveen, it will be very helpful if you can include a link to download the codes you type.
Thank you

adithyak
Автор

From 4:37 you stop using super keyword still your code calling both constructor how
.
Please help😅

SidTheBot
Автор

sir, but in inheritence u told that if we pass the parameter of class B, then by default then  the default method of class A will be called i.e is if we call B obj=new B(5), then output will be " in const A
                      in const B para"
but in super the output is " in const A para
                                       in const B para"
which one is correct sir, pls explain

snehayannam
Автор

is there any way to execute B first then A if B extends to A

subhadiphazra
Автор

@5:42
What if we remove default constructor in class A i.e public A()

If we run the code now, will it produce only b class parameter constructor?

universalstarcreations
Автор

where can we see the code which automatically extends every Class to Object class?

birkhansonkan
Автор

So you must have a default constructor to use super ()?

Chandler
Автор

hahahahhahaha... finally got it i was about to cry...trying since freeking hours.. hah.

shahdabtemori
Автор

Can we call parameterized constructor of superclass from the default constructor of subclass?

vaasudhand
Автор

Why would it be beneficial to create both objects by default. Has java always been like that?

slightlygruff
join shbcf.ru