Search Interview Questions | ![]() ![]() Click here and help us by providing the answer. ![]() Click Correct / Improve and please let us know. |
|
| ||||
Core Java - Interview Questions and Answers for 'Constructor vs instance initialization blocks' - 1 question(s) found - Order By Newest | ||||
| ||||
Ans. Constructor has the same name as class name whereas instance initialization block just have a body without any name or visibility type. instance initialization blocks are useful if we want to have some code run regardless of which constructor is used or if we want to do some instance initialization for anonymous classes. | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
![]() | ||||
![]() | ||||
![]() | ||||
![]() | ||||
![]() | ||||
![]() | ||||
![]() | ||||
![]() | ||||
![]() | ||||
![]() | ||||
![]() | ||||
![]() | ||||