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
Garbage collection in java?
what is the role of xml in core java?? and how we can use it?? can somebody give a sample program with explanation and from where i can read more about xml?????
How can you write a loop indefinitely in java programming?
Why is string buffer better than string ?
What is a method type?
What is difference between variable declaration and definition?
How do you invoke a method?
Describe string intern() methodology
What are the differences between heap and stack memory?
What is a char in java?
Explain about anonymous inner classes ?
What is double in java?
what is synchronization? : Java thread
How to solve the problem of generating the unique hash keys with hash function?
What is difference between call by value and call by reference?