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
Define Multiprogramming and Multiprocessing in java.
How do you use parseint in java?
What are keywords in programming?
What does it mean to be immutable?
Is java a virus?
How are java objects passed to a method and what are native methods?
What are the types of methodology?
What is identifier give example?
What are encapsulation, inheritance and polymorphism?
What is predicate in java?
What is autoboxing and unboxing?
How to find the index of the largest number in an arraylist java?
What is a generic data type?
Can we clone singleton object in java?
What is constant in programming?