Difference between this(), super()?

Answer Posted / shanthappa

"this" is the implicit keyword/object oriented by the jvm and supplied to every java programs for two purposes.
1) It points to current class object
2) It whenever formal parameters of the class are similar then jvm gets an ambiguity.
"super" is a keyword which will differentiate base class features with derived class features.
The keyword 'super' is placing an important role in three places in java...
1)at variable level
2)at constructor level
3)at method level

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between length and size in java?

489


How is garbage collection controlled?

723


Explain tree set and its features?

593


How do you sort in java?

578


Explain what access modifiers can be used for methods?

557






There are two classes named classa and classb. Both classes are in the same package. Can a private member of classa can be accessed by an object of classb?

985


What is the null?

531


What is fail fast in java?

571


What is string subsequence method?

616


Can we call a non-static method from inside a static method?

551


What are the types of inner classes (non-static nested class) used in java?

551


What is an infinite loop in java? Explain with an example.

574


What is thread life cycle in java?

572


How to reverse string in java?

606


What is anti pattern in java?

508