What is the difference between super and this keyword in java? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What is the difference between super and this keyword in java?

As we can call both child and parent from super and this as well?

12th Jul 2017, 7:48 PM
Ishan Kumar
Ishan Kumar - avatar
1 Answer
+ 2
super references the parent class, and this references the current class you're in.
13th Jul 2017, 2:45 AM
Andrew Lampert
Andrew Lampert - avatar