Day-119: Java Instance Blocks Confusing You!? 😵‍💫 Count the Count Carefully! #shorts #java

preview_player
Показать описание
In this short video we will see a question related to Java Instance. Hope you were able to answer it before seeing the solution. Correct answer is "7-0-2-4-".

Subscribe the channel for regular Java updates.
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
Social Media Handles:
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
Copyright © 2025 Abhishek Verma - All Rights Reserved
Рекомендации по теме
Комментарии
Автор

D. Explanation : Order of execution - init fields with def values -> static blocks -> instance blocks -> constructors
Remember static and instance blocks are executed when JVM loads the class

kdvr
Автор

Can somebody explain how 4- is getting printed at the end? I'm confused

nivedhasankaran
Автор

but count is not initialized, so what is default value here. can someone guide me on this.

vijayadurga
join shbcf.ru