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
Difference between object and reference?
Addition to previous section relative word 5th one was Putrid ans: rotten, also there was prob. in 1st section on bucket weight ans:10kg, also there was a prob. on train speed to find bridge length ans:800 mtrs.
What is generic class?
What is the use of math abs in java?
What is hash code collision?
Does java runtime require a license?
What is serial version uid and its importance in java?
How will you call an Applet using Java Script Function?
what is thread? What are the high-level thread states? Or what are the states associated in the thread? : Java thread
Explain java coding standards for methods?
How do you convert bytes to character in java?
What checkbox method allows you to tell if a checkbox is checked?
Give differences between Quicksort &Mergesort. When should these sorts be used andwhat is their running time in java?
What is adapter in java?
Explain the difference between collection api and stream api in java8?