How are this() and super() used with constructors?

Answer Posted / ranganathkini

this() - is used to invoke one constructor from another
constructor.

super() - is used to invoke the super class's constructor
from the subclass's constructor

Is This Answer Correct ?    21 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can a class be declared as static?

663


how can you catch multiple exceptions in java?

529


What is http client in java?

509


Is final static java?

531


How does finally block differ from finalize() method?

572






What is java jit compilers?

552


What is your platform?s default character encoding and how to know this?

1741


What happens to the Exception object after handling an exception?

1799


What is == in java?

552


What are data types in programming?

537


Differentiate between == and equals().

577


What is the use of join method?

562


How can we achieve thread safety in java?

669


What is r * in math?

538


Explain the difference between map and flatmap stream operation?

805