Difference between this(), super()?

Answer Posted / nikhlesh gupta

this() call one of user define constructor inside another user constructor of the same class such as this(a), this(a,b) & so on.
super() call one of base class constructor inside the derive class constructor such as super(a), super(a,b) & so on.

Is This Answer Correct ?    26 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can constructor chaining be done using this keyword?

584


What are different data structures in java?

525


Define how can we find the actual size of an object on the heap?

650


What is the use of private static?

531


How to display all the prime numbers between 1 and 100

499






Is it correct to say that due to garbage collection feature in java, a java program never goes out of memory?

570


What is class and its types?

536


Explain the use of javap tool.

628


What is a lightweight component?

588


What are the actions that can occur when a thread enters blocked state?

576


Why hashset is used in java?

530


What is type inference in java8?

573


Is binary a low level language?

496


Can a final method be overloaded?

504


What is a method header?

542