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 the driver class?

560


Is null a keyword in java?

549


Explain access modifiers in java.

572


What are assembly attributes?

537


what do you mean by classloader in java?

562






What is Java Annotations?

549


What are the differences between graph and tree?

639


Which method must be implemented by all threads?

713


What does += mean in java?

563


What is the largest data type in java?

502


What are java packages? What's the significance of packages?

615


What is args length in java?

648


Explain about method local inner classes or local inner classes in java?

561


Which one of the following suits the description of a string better: derived or primitive?

499


What is the difference between declaration and definition in java?

508