Does a class inherit the constructor of its super class?if
it does, how can you hide that constructor? if it doesnot
how can you call it from the sub class?

Answer Posted / pandu

Hi ,
constructor is never been inherited from superclass to
subclass.
we can call the Super class constructor in Sub class
by using
Super();
that too this stement should be first line in method.

Best Regards.

Is This Answer Correct ?    10 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are void methods?

656


Describe the syntax of multiple inheritance? When do we use such an inheritance?

685


Why runnable interface is used in java?

681


What class of exceptions are generated by the java run-time system?

740


What does this () mean in constructor chaining concept?

675






How to reverse string in java?

720


what do you mean by classloader?

632


Where local and global variables are stored?

645


Which way a developer should use for creating thread, i.e. Sub classing thread or implementing runnable.

614


What are the types of strings?

659


What is the difference between JVM and JRE?

707


What programs use java?

565


What is fundamental datatype?

618


What is the difference between the boolean & operator and the && operator in java programming?

650


Can we extend private class in java?

652