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

Marie curie speech: the discovery of radium answers
if ur cam works and is set up on ur computer to use.. wats it mean when it says cant support wat ur tryin to use it for?
which type of energy is transfered by vibrational waves
explain why the exponents cannot be added in the product 12^3 * 11^3
You want to limit the amount of television you watch to an average of at most 1.5 hours per week during an 8-week period. how many hours xx of television must y
Libaray of congress is the responsibilty of which govrrnebtal branch
Which two properties can be used to find (3.4 x 4) x (25 x 1)? explain.?
the sum of two numbers is 13 and there difference is 5 what are the 2 numbers?
In a boaster club,1/8 of the 128 members are men how many male member are in the club
What is the kinetic energy of a 2,000kg boat moving at 5 meters per second?