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 |
Why char array is favored over string for the storage of passwords?
What is the purpose of tostring() method in java?
What is an object’s lock and which object’s have locks?
What are Access Specifiers and Access Modifiers.
Explain about class in java?
Describe 2 different ways to concatenate two strings.
what is meant wrapper classes?
Can a private method be declared as static?
What is the gregoriancalendar class in java programming?
How do I remove a character from a string in java?
What are inbuilt functions?
What does method mean?