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
What is the difference between length and size in java?
How is garbage collection controlled?
Explain tree set and its features?
How do you sort in java?
Explain what access modifiers can be used for methods?
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?
What is the null?
What is fail fast in java?
What is string subsequence method?
Can we call a non-static method from inside a static method?
What are the types of inner classes (non-static nested class) used in java?
What is an infinite loop in java? Explain with an example.
What is thread life cycle in java?
How to reverse string in java?
What is anti pattern in java?