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

In which order the iterator iterates over collection?

556


What is difference between static variable and global variable?

525


Why are generics used?

496


What is identifier in java?

528


What is method reference?

496






What do you understand by java virtual machine?

679


What are the different types of inner classes?

511


What does i ++ mean in Java?

481


How many bytes is a unicode character?

484


Can inner class extend any class?

575


What are the types of strings?

540


What is the purpose of static methods and static variables?

519


What programs use java?

444


Why static functions are used?

547


Can you override static methods?

485