Jdkdbdb2893 Jdkdbdb2893
  • 02-03-2020
  • Computers and Technology
contestada

If class C inherits class B. And B has inherited class A. Then while creating the object of class C, what will be the sequence of constructors getting called?

Respuesta :

Myth8
Myth8 Myth8
  • 04-03-2020

Answer:

Constructor of A then B, finally C

Explanation:

A constructor in Java is a method of initializing objects. The constructor is called when an object of a class is created. It can be used to set initial values for object characteristics.

In creating the object of class C, its constructor would be called by default. But, if the class is inheriting some other class, firstly the parent class constructor will be called so that all the data is initialized that is being inherited.

Answer Link

Otras preguntas

Add 280.00 +21.40 +6.30 +.41 = 308.71, I don't know where the 7 was added though
how would you solve it. I know the answer already. my problem working it out. 4b/2 + 3 = 11 + b.
12. The source of the sun's heat is
In a study conducted for the state department of education, 30% of the teachers who left teaching did so because they were laid off. assume that we randomly sel
the two lines graphed
What is the probability of receiving a 6 or a 9 from a deck of 52 cards and an ace or a king?
what is the involuntary movement of the muscles that move food through the digestive system.
"what are the two major unix system versions?"
If Julie invests $9,250 at a rate of 7%, compounded weekly, find the value of the investment after 5 years. $13,455.78
how to find out the length of slant edge?