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


Question 24: How to make your own custom



Download 7,31 Mb.
Pdf ko'rish
bet14/89
Sana21.04.2022
Hajmi7,31 Mb.
#571320
1   ...   10   11   12   13   14   15   16   17   ...   89
Bog'liq
Grokking-The-Java-Developer-Interview-More-Than-200-Questions-To-Crack-The-Java -Spring -SpringBoot-

Question 24: How to make your own custom
exception class?
Answer: In java, you can create your own custom exception class
which are basically derived classes from the Exception class.
For Example:


C:\Users\jjatin\Desktop\Different Versions\All_Photos\Question
24\color1.png


C:\Users\jjatin\Desktop\Different Versions\All_Photos\Question
24\color2.png


Output:
C:\Users\jjatin\Desktop\Different
Versions\All_Photos\Question 24\output.png


Question 25: How to make custom checked /
unchecked exception?
Answer: If you want to make a custom unchecked exception class
then extend RuntimeException and for creating a custom checked
exception class, extend Exception class.
Question 26: What happens when you throw an
exception from finally block?
Answer: When exception is thrown from finally block, then it takes
precedence over the exceptions that are thrown from try/catch block
Question 27: What will be Output of below program
related to try-catch-finally?


C:\Users\jjatin\Desktop\Different Versions\All_Photos\Question
27\color1.png


C:\Users\jjatin\Desktop\Different Versions\All_Photos\Question
27\color2.png


C:\Users\jjatin\Desktop\Different Versions\All_Photos\Question
27\color3.png


With everything you have read so far, you should be able to answer
this easily. I will leave this one for you.

Download 7,31 Mb.

Do'stlaringiz bilan baham:
1   ...   10   11   12   13   14   15   16   17   ...   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