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


Please Help Members By Posting Answers For Below Questions

What is collection sort in java?

558


Is static a singleton?

527


What does %4d mean in java?

843


What are design patterns and please explain?

574


What are the important features of Java 9 release?

538






How do you decide when to use arraylist and linkedlist?

535


What is string in java with example?

493


What is an example of a conditional statement?

567


What is string and its types?

613


Is a string literal?

526


What are the different types of java?

561


Is vector synchronized in java?

558


What is a double?

591


What are the advantages of inner classes?

509


What are new features introduced with java 8 ?

552