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 |
How to make class immutable
What is default locale java?
What does the “final” keyword mean in front of a variable? A method? A class?
What are the advantages of user defined functions?
if i have one string class then how can you achive this class functionality of this class?
What is flag in java?
What is the default value of local and global variables?
What are the operands of instanceof operator?
What are the differences between throw and throws?
Is a case study a method or methodology?
What are unchecked exceptions in java?
JSP is by default thread safe or not? what is the meaning of isThreadSafe="true" and isThreadSafe="false". Explain it? Thanks, Seenu