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

Scientists who study Atlantic salmon have found that the oxygen consumption of a yearling salmon O is given by the function O=100. 3^(3s/5) , where s is the spe
PLEASE HELP What is the mode of the following set of numbers? 51, 73, 82, 51, 73, 103, 73, 125, 82, 125 51 73 125 82
What was an effect of major environmental issues that occurred in the 1960’s?.
simplify 5^ 3log(5)^6
Use patterns of zeros to find 5600÷7 show your work.
What are the disadvantages of wind pollution
PLEASE HELP The ratio of boots to sandals in a shoe store is 8:3. If there are 245 more boots that sandals in the store, how many boots are there?
What are some possible benefits to a nomadic lifestyle, and what are some possible benefits of a town lifestyle?
List the main features that define life in a material sense?
How might a soldier inconspicuously attack his enemy?