Answer Posted / 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 |
Post New Answer View All Answers
Write a program in java to find the maximum and minimum value node from a circular linked list.
What does s mean in regex?
What are 3 data types?
Is 0 true or is 1 true?
What is number data type in java?
Is 0 true or false?
What is linked hashset and its features?
What are scriptlets?
Why we go for collections in java?
What are annotations in java?
Explain list interface?
Who developed java?
What type of language is java?
Explain about data types?
What is difference between fail-fast and fail-safe?