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
What is a layout manager and what are different types of layout managers available in java awt?
What is a ternary operator in java? What is an interface?
What is the argument in java?
How do you avoid global variables?
What is an empty class? What functionality does it offer in Java?
Can we use switch statement with strings?
Can It is possible to synchronize the constructor of a Java Class?
Can we have static methods in an interface?
What about static nested classes in java?
Are true and false keywords?
Is string is a class in java?
What are the important methods of java exception class?
What is the importance of main method in Java?
What is thread life cycle in java?
What is treeset in java?