Pergunta de entrevista da empresa Intelizign

1) If Child class has parameterized constructor and parent class has default constructor . will it work

Respostas da entrevista

Sigiloso

9 de jul. de 2018

That will work, compiler writes super call in first line of constructor.

1

Sigiloso

30 de out. de 2018

Yes it will work.

1

Sigiloso

29 de nov. de 2018

It will work, because super() call from child constructor will call no arg constructor of parent which is by default provided by compiler. But if parent also have parameterized constructor then it will not work, because super() call from child constructor will not find no argument constructor in parent

Sigiloso

28 de out. de 2017

Nope the old man is correct and u were wrong, the answer is it will not work

2

Sigiloso

31 de mai. de 2018

It will work. As constructor cannot be overriden. It can be just override in same class.

Sigiloso

20 de nov. de 2016

My answer is yes as java automatically provides a super call on first line of constructor . Interviewer who was almost 35-37 years old so at least have 10-15 years of experience dont know this concept and we argued on this after which i was told to work on my technical skills and I was like common man

3