Тёмный

Checked Vs unchecked Exceptions with example in Java Interview Questions and Answers | Code Decode 

Code Decode
Подписаться 129 тыс.
Просмотров 29 тыс.
50% 1

Difference between checked and unchecked exception is very commonly asked java interview questions in every interview
Udemy Course of Code Decode on Microservice k8s AWS CICD link:
openinapp.co/udemycourse
Course Description Video :
yt.openinapp.co/dmjvd
Difference between checked vs unchecked exceptions
Checked
Unchecked Exceptions
Another name
Checked exceptions are checked by the Java compiler so they are called compile time exceptions.
Unchecked exceptions are not checked by the compiler. These are called runtime exceptions.
When
Checked exceptions occur at compile time.
Unchecked exceptions occur at runtime.
Handled by
These types of exceptions can be handled at the time of compilation.
These types of exceptions cannot be catched or handled at the time of compilation, because they get generated by the mistakes in the program.
Handling
Must be handled in a try-and-catch block, or be thrown by the invoking method
Exception handling semantics are not required
Difference between checked vs unchecked exceptions
Checked
Unchecked Exceptions
Force
Java compiler forces us to handle these exceptions in some manner
A method is not forced by the compiler to declare the unchecked exceptions into the method declaration.
Hierarchy
They are all subclasses of Exception.
They are all subclasses of RuntimeException.
Scenario
Checked Exception represent scenario with higher failure rate
UnChecked Exception are mostly programming mistakes.
Throws clause
The throws clause on a method header must be included for checked exceptions that are not caught and handled in the method.
The throws clause on a method header is not mandatory
Checked
Unchecked Exceptions
Examples
File Not Found Exception
No Such Field Exception
Interrupted Exception
No Such Method Exception
Class Not Found Exception
No Such Element Exception
Undeclared Throwable Exception
Empty Stack Exception
Arithmetic Exception
Null Pointer Exception
Array Index Out of Bounds Exception
Most Asked Core Java Interview Questions and Answers: • Core Java frequently a...
Advance Java Interview Questions and Answers: • Advance Java Interview...
Java 8 Interview Questions and Answers: • Java 8 Interview Quest...
Hibernate Interview Questions and Answers:
• Hibernate Interview Qu...
Spring Boot Interview Questions and Answers:
• Advance Java Interview...
Angular Playlist: • Angular Course Introdu...
SQL Playlist: • SQL Interview Question...
GIT: • GIT
Subscriber and Follow Code Decode
Subscriber Code Decode: ru-vid.com?...
LinkedIn : / codedecodeyoutube
Instagram: / codedecode25
#exceptions #java #codedecode

Опубликовано:

 

6 дек 2022

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 26   
@Aniruddhdwivedi
@Aniruddhdwivedi Год назад
Correct me if I am wrong - All exceptions occur at runtime. The only difference is Java compiler checks probable places in code for checked exceptions and forces developers to handle them.
@CodeDecode
@CodeDecode Год назад
Correct. Just that we can say they both occur during exception of code. Compile time - conversation of. Java to. Class ( saved in target folder) and. Class to exe is run time. But be very careful while answering this question as this is so much debatable question and trust me most of the interviewers just see what's written on internet and judge you on that. Our suggestion " be diplomatic on this debatable question " 👍👍
@user-pt5ue6ep9y
@user-pt5ue6ep9y 8 месяцев назад
Super explanation. Thank you so much
@CodeDecode
@CodeDecode 8 месяцев назад
You are welcome
@iron-man-507
@iron-man-507 Год назад
very helpful video ...thanks
@CodeDecode
@CodeDecode Год назад
🙂🙂
@nikitasarda7389
@nikitasarda7389 10 месяцев назад
Hi, first of all thank you so much! Can we get notes for all the videos?
@ShivaniDiware
@ShivaniDiware Год назад
Hi Code Decode , I really appreciate your efforts & your content is helping me a lot during interviews recently I have get some interesting questions if possible can you cover those as well? 1.characteristics of rest web services 2.what is Richardson Maturity Model?
@CodeDecode
@CodeDecode Год назад
Hey Shivani. Thanks Girl 🥰. Sure we will cover them but which company asked these Richard types questions😒. Sad to see such questions😐
@ShivaniDiware
@ShivaniDiware Год назад
@@CodeDecode its asked during internal client interview for American Express
@soulfulGirl_
@soulfulGirl_ Год назад
This Richardson Maturity was asked in epam for me as well ... And can you please made some videos on transaction roll backs please , do we need to roll back only checked exception in transaction?
@CodeDecode
@CodeDecode Год назад
We have it Harshini . ru-vid.com/group/PLyHJZXNdCXsdPNwIReIMeC_Cr23Szi5tR Please do check this
@CodeDecode
@CodeDecode Год назад
Sure Shivani we will create video on this👍. We didn't know it's been asked intensively 👍👍 thanks Girl 🥰
@Jamie-jz2ti
@Jamie-jz2ti 27 дней назад
Thank you Mam 🙏
@CodeDecode
@CodeDecode 24 дня назад
Most welcome 😊
@sambayeti1525
@sambayeti1525 Год назад
Could u please make videos on executor and fork and join framework concepts in multithreading...
@CodeDecode
@CodeDecode Год назад
Sure 👍👍🙂🙂
@SaeedAhmed-gl3xn
@SaeedAhmed-gl3xn Год назад
All Exceptions are handled at run time. It is not very much correct to say compile time Exceptions. Instead checked Exceptions are those which occur at run time only but compiler checks if it is handled by the developer or not. Checking is done at compile time for checked exceptions but occurring of Exceptions are always run time only.
@CodeDecode
@CodeDecode Год назад
Can you please suggest us some good reliable source of this information. It will be a great help for all of us n our subscribers Saeed 🙏👍👍🙂🙂
@CodeDecode
@CodeDecode Год назад
What we found in blogs n papers is : Just that we can say they both occur during excution of code. Compile time - conversation of. Java to. Class ( saved in target folder) and. Class to exe is run time.
@shobhitmittal77
@shobhitmittal77 Год назад
@@CodeDecode Here it is - ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-V_1IEx15QmE.html&ab_channel=DURGAEDUCATION
@yourvoices
@yourvoices Год назад
Mam please tell me can we create both type of exception in java?
@CodeDecode
@CodeDecode Год назад
Yeah you can sandeep
@yourvoices
@yourvoices Год назад
​@@CodeDecodebut how can you explain me mam.?
@rishiraj2548
@rishiraj2548 Год назад
🙏👍👍💯💯
@CodeDecode
@CodeDecode Год назад
Thanks 🙂🙂
Далее
▼ЧЁРНАЯ МАГИЯ 🔮
31:15
Просмотров 353 тыс.
BABYMONSTER - ‘FOREVER’ M/V
03:54
Просмотров 10 млн
▼ЧЁРНАЯ МАГИЯ 🔮
31:15
Просмотров 353 тыс.