********** Welcome to Our Youtube Channel *************
OBJECT ORIENTED PROGRAMMINGUNIT III
EXCEPTION HANDLING AND I/O
3.3 built-in exceptions, creating own exceptions
OBJECT ORIENTED PROGRAMMINGUNIT III EXCEPTION HANDLING AND I/O3.3 built-in exceptions, creating own exceptions
2UNIT III EXCEPTION HANDLING AND I/O●Exceptions -exception hierarchy ●-throwing and catching exceptions ●–built-in exceptions, creating own exceptions, Stack Trace Elements. ●Input / Output Basics –Streams –Byte streams and Character streams ●–Reading and Writing Console –Reading and Writing Files
3Categories of Exceptions●1.Checked exceptions−A checked exception is an exception that occurs at the compile time, these are also called as compile time exceptions .These exceptions can not simply be ignored at the time of compilation, the programmer should take care of (handle) these exceptions.●2.Unchecked exceptions −An unchecked exception is an exception that occurs at the time of execution. These are also called as Runtime Exceptions. These include programming bugs, such as logic errors or improper use of an API . Run time exceptions are ignored at the time of compilation.
4Java’s Built-in Exceptions●1) Scenario where ArithmeticException occurs If we divide any number by zero, there occurs an ArithmeticException.int a=50/0;//ArithmeticException●2) Scenario where NullPointerException occurs If we have null value in any variable, performing any operation by the variable occurs an NullPointerException.●3) Scenario where ArrayIndexOutOfBoundsException occurs If you are inserting any value in the wrong index , it would result ArrayIndexOutOfBoundsException as shown:int a[]=new int[5];
5User-defined Exceptions●All exceptions must be a child of Throwable .●If we want to write a checked exception that is automatically enforced by the Handle ,we need to extend the Exception class.●User defined exception needs to inherit (extends) Exception class in order to act as an exception.●throw keyword is used to throw such exceptions.
you can also participate and helps us to increase the quality of content Through donations all funds helps to our higher education
Link ; https://www.paypal.me/kraiseprince
details and step by step explanation Telegram channel link
E-learners and researchers room
https://t.me/QuickThrough
-------------------------------------------------------
Copyrights: QuickThrough 2020
For more video subscribe to your channel
DISCLAIMER: " THIS VIDEO IS ONLY FOR EDUCATION PURPOSE AND WE DON'T PROMOTE ANY ILLEGAL ACTIVITIES USING HACKING "
NOTE: " THIS CHANNEL DOESN'T CLAIMS ANY RESPONSIBILITY FOR THOSE ILLEGAL ACTIVITIES"
tags:-
data structures course,java data structure,data structures and algorithms tutorial,data structues,algorithms tutorial,crashcourse,struct,red-black trees,data structure and algorithms,linked list in data structure,queue data structure,tree in data structure,data structure tutorials,learn data structures,data structure and algorithm,queue operations in data structure,enqueue and dequeue in data structure,tree data structure,c data structures,data structure queue