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

[tex]x^{2} +y^{2}\leq 1\\y-x^{2}\ \textgreater \ 0[/tex]
There are ___ kinds of fats. 2 3 4
1. JACKSON WALKS 6 BLOCKS IN 4 MINUTES. HOW FAST IS HE WALKING?
divide then write in simplest form 5 divided by 5/6, 3 divided by 5/6, 10 dived 5/6 4 divided 5/9, 6 divided by 2/3
How much energy is required to change 75 grams of copper at 35 degrees Celsius to liquid copper at 1200 degrees C?
40 POINTS ALSO WILL GIVE BRAINLIEST RIGHT ANSWERS ONLY! What is different about conjugations for regular verbs in the future tense? (choose all that apply) don'
find the surface area. THANKS
In the heating curve of an unknown substance, the line labeled C represents what change(s)? A) Temperature B) Kinetic Energy C) Temperature and Kinetic Energy
Im kind of confused on this practice problem
Find the value of x.