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
Write a program to print 15 random numbers using foreach of java 8?
What is the use of runnable interface?
What are runtime exceptions?
Can a set contain duplicates?
What is an infinite loop? How infinite loop is declared?
What is the largest number a double can hold?
What is jpa specification?
How many types of gc are there in java?
Can we override constructor in java?
Why are global variables used?
What is the byte range?
What is token in java?
How many types of keywords are there?
When is the finalize() called? What is the purpose of finalization?
how would you implement a thread pool? : Java thread