why the abstract class has default constructor?
Answers were Sorted based on User's Feedback
Answer / ranganathkini
A class has a constructor so that when an instance of the
class is created, the fields of the class can be setup to a
initial valid state.
Abstract classes define partial implementation of a public
contract. Which means that it may implement some of the
methods and contains partially implemented methods that are
marked abstract.
Since abstract classes can have partial implementation and
such partial implementation can include fields of the class,
a constructor becomes necessary so that those fields are
initialized to a valid default state when they are created
thru the constructor of their concrete subclasses.
| Is This Answer Correct ? | 12 Yes | 4 No |
Answer / amandeep
A Abstract Class Can't Have An Default constructor........Cause It Can't Have An Instance Of It.....
| Is This Answer Correct ? | 2 Yes | 10 No |
Explain about instanceof operator in java?
What is jvm? How its run?
How can the checkbox class be used to create a radio button?
I am unable to find or learn about print command. I have a graphical program in core java in applet but i want to give print command but i have coding for that so if anyone know about this plz mail me on avdhesh_chauhan007@yahoo.co.in
How do you reverse a string in java?
Give differences between Quicksort &Mergesort. When should these sorts be used andwhat is their running time in java?
Where import statement is used in a java program?
What is static variable with example?
Write the algorithm to check the number non-leaf nodes in a tree.
What is the difference between synchronized and synchronized block?
What is compiler and what its output.
How to convert string to char and vice versa?