Difference between this(), super()?
Answer Posted / priyanka das
"super" is a keyword used to invoke superclass data members and also superclass member methods,whereas "this" is a keyword used to invoke the current class data member as well as current class member methods.
A super object can be used to retrieve super class members."this' object can be used to invoke only the current class members.
Again super() can be used to invoke the superclass constructor where as this() can be used to invoke current class constructor.
| Is This Answer Correct ? | 23 Yes | 0 No |
Post New Answer View All Answers
What are the six ways to use this keyword?
Why do we need data serialization?
How do you do absolute value in java?
What is the intersection and union methods?
Can we write method inside a method in java?
Is array passed by reference in java?
What is a treemap in java?
What is local class in java?
What is the main purpose of serialization in java?
Is constructor inherited?
Give a brief description of java socket programming?
What is the difference between hashmap and hashtable in java?
Are registers volatile?
What is static import?
What are the restriction imposed on a static method or a static block of code?