filmov
tv
#7 What are checked and unchecked exceptions in Java? #shorts #javaprogramming

Показать описание
In this short we explain how not to answer in Java interview when questioned about What are checked and unchecked exceptions in Java? #shorts #javaprogramming
Generally candidates say Checked exceptions occur at compile time and unchecked exceptions occur at runtime
Instead we shold say that Checked exceptions are exceptions that the compiler forces us to handle or declare in a method signature using the throws keyword eg I/OException. while Unchecked exceptions are exceptions that the compiler does not force you to handle explicitly like NullPointerException or ArithmeticException.
Tell in comment section What is your way of giving correct answer?
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
Subscribe to our channel and press the bell icon to get regular updates:
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
📌 Social Media
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
Copyright © 2023 ScaleUp India - All Rights Reserved
Generally candidates say Checked exceptions occur at compile time and unchecked exceptions occur at runtime
Instead we shold say that Checked exceptions are exceptions that the compiler forces us to handle or declare in a method signature using the throws keyword eg I/OException. while Unchecked exceptions are exceptions that the compiler does not force you to handle explicitly like NullPointerException or ArithmeticException.
Tell in comment section What is your way of giving correct answer?
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
Subscribe to our channel and press the bell icon to get regular updates:
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
📌 Social Media
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
Copyright © 2023 ScaleUp India - All Rights Reserved