Can you have a constructor in abstract class?

Answer Posted / abdul hannan

Yes. We can have constructor in an abstract class but we can
not directly instantiate it. If the abstract class have no
argument constructor, it will automatically call by the
constructor of subclass through constructor chaining. If
abstract class have constructor with argument, then we need
to call it by super() and pass the argument in it.

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can arraylist contain null values?

760


What are the ways to instantiate the class class?

805


Explain what are final variable in java?

800


What is an i/o filter?

1202


Can I learn java without any programming experience?

786


What is comparator in java?

748


Is null an object java?

748


How do you call a reference in java?

708


What are the steps that are followed when two computers connect through tcp?

762


What are keywords and reserved words in java?

791


Explain about public and private access specifiers?

771


What is the difference between stringbuffer and stringbuilder class?

809


How do you use equal in java?

738


What is mnemonic in assembly language?

817


Why java is called not pure object oriented language?

818