Answer Posted / kabita
'this' and super are two keywords in java.
'this' doesn't support inheritance bt 'super' supports
inheritance.
this keyword is used in two cases
1.to differentiate betn instance and local variables.
2.calling of one constructor from another constructor.
Restriction:this keyword should be written in lowercase &
must used in firstline.more than one 'this' keyword is not
used in one block.
super is used 4 three reason.
1.differentiates betn superclass variable & child class
variables.
2.calling of superclass constructor in childclass
constructor.
3.it is also used in calling of superclass override method
in child class.
restriction:
it must be in 1stline.
must be in lowercase.
| Is This Answer Correct ? | 4 Yes | 0 No |
Post New Answer View All Answers
Explain the polymorphism principle?
What are peerless components in java programming?
What are memory tables?
Difference between string s= new string (); and string s = "abv";?
what methods would you overwrite in java.lang.object class?
why java uses class level type casting ?
What is meant by flickering?
Give the hierarchy of inputstream and outputstream classes.
What is super in java?
What are green threads in java?
What is core java called?
Why a dead thread occurs?
How variables are stored in memory?
What is the difference between jdk and jre?
Why do we need array in java?