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

Bronze age advances in which are of knowledge made th construction of buildings like this one possible?
the red Scott case was an important Supreme Court case in the pre-civil war era what was died Scott fighting for? need an answer ASAP!!!!!!!!! PLEASEEEEE!! :D
What is the name of a complex group of orgaisms that are connected and interact with one another?
Help please. Apply the distributive property and simplify, if possible. 0.08 (x +6,000)
Use the frequency table. Find the probability that a person goes to the movies at least 5 times a month. Round to the nearest thousandth.
What is the area of the figure?
Describle the route taken by blood from the intestine to the kidney
which of the following offers the most complete list of how proteins function in the body A) Energy production, enzyme development, increased reaction speed B)
2/5 = m/70 please solve
I Need help with Number 2 And 4 asap pls