Throw vs Throws in Java | Checked vs Unchecked Exception in Java | Java Interview Questions

Publicado em: 08 November 2019
no canal de: PrepBytes
845
24

Difference between Throw in Java and Throws in Java & Difference between Checked Exception and Unchecked Exception in Java is a very important Java Interview Question.

This video very clearly answers the above questions

Crack your next Coding Interview: http://bit.ly/2K66awp

What is throw in Java?

throw is a keyword in Java that is used while writing code to throw the exception.

What is throws in Java?

Throws is used to list down all the exceptions that a method might throw such that the code calling the method knows that these exceptions might occur hence suitable handling has to be done.

What are Checked Exceptions and Unchecked Exceptions in Java?

Checked Exceptions are the exception that must be handled by the code else you get compilation error or in other words all the exceptions for which compiler checks whether it is handled or not are called Checked Exceptions, hence it is mandatory to handle checked exception whereas Exceptions that are not checked by compiler whether they are handled or not are called Unchecked Exceptions.

Example of Checked Exceptions are ClassNotFoundException, IOException, SQLException.

Example of Unchecked Exception are ArithmeticException, NullPointerException etc.

Follow Insta to get more such useful Content :   / prepbytes  
FB :   / prepbytes0211  


Nesta página do site você pode assistir ao vídeo on-line Throw vs Throws in Java | Checked vs Unchecked Exception in Java | Java Interview Questions duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário PrepBytes 08 November 2019, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 845 vezes e gostou 24 espectadores. Boa visualização!