0

When we instantiate a Child class object, the parent class's constructor is also called. So is it a creation of an object of the parent class?

yshavit
  • 42,327
  • 7
  • 87
  • 124
Kalhan.Toress
  • 21,683
  • 8
  • 68
  • 92

1 Answers1

0

according to this question when you instantiate child class using new operator only child class object will create. you can think as parent constructor code is in child constructor code because of inheritance

Community
  • 1
  • 1
lakshman
  • 2,641
  • 6
  • 37
  • 63
  • `only child class object will create` doesn't feel complete to me. Especially since `child instanceof parent` will return true. – Cruncher Mar 21 '14 at 20:43