Grokking The Java Developer Interview: More Than 200 Questions To Crack The Java, Spring, SpringBoot & Hibernate Interview



Download 7,31 Mb.
Pdf ko'rish
bet28/89
Sana21.04.2022
Hajmi7,31 Mb.
#571320
1   ...   24   25   26   27   28   29   30   31   ...   89
Bog'liq
Grokking-The-Java-Developer-Interview-More-Than-200-Questions-To-Crack-The-Java -Spring -SpringBoot-

Question 49: What is init block?
Answer: init block is called instance initializer block


init block is used to initialize the instance data members
init block runs each time when object of the class is
created
init block runs in the order they appear in the program
compiler replaces the init block in each constructor after
the super() statement
init block is different from static block which runs at the
time of class loading
Example 1:


C:\Users\jjatin\Desktop\Different Versions\All_Photos\Question
49\Example 1\color.png


Output:


C:\Users\jjatin\Desktop\Different Versions\All_Photos\Question
49\Example 1\output.png


Example 2:


C:\Users\jjatin\Desktop\Different Versions\All_Photos\Question
49\Example 2\color1.png


C:\Users\jjatin\Desktop\Different Versions\All_Photos\Question
49\Example 2\color2.png


C:\Users\jjatin\Desktop\Different Versions\All_Photos\Question
49\Example 2\color3.png


Output:


C:\Users\jjatin\Desktop\Different Versions\All_Photos\Question
49\Example 2\output.png


Example 3:


C:\Users\jjatin\Desktop\Different Versions\All_Photos\Question
49\Example 3\color1.png


C:\Users\jjatin\Desktop\Different Versions\All_Photos\Question
49\Example 3\color2.png


C:\Users\jjatin\Desktop\Different Versions\All_Photos\Question
49\Example 3\color3.png


Output:


C:\Users\jjatin\Desktop\Different Versions\All_Photos\Question
49\Example 3\output.png



Download 7,31 Mb.

Do'stlaringiz bilan baham:
1   ...   24   25   26   27   28   29   30   31   ...   89




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish