0% found this document useful (0 votes)
4 views3 pages

Exception Handling

The document discusses exception handling in programming, focusing on runtime errors and their management to maintain normal execution flow. It outlines the structure of try, catch, and finally blocks, as well as the distinctions between checked and unchecked exceptions. Additionally, it explains the concepts of 'throw' and 'throws' in exception handling, along with the final, finally, and finalize keywords.

Uploaded by

nitinsingh3264
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views3 pages

Exception Handling

The document discusses exception handling in programming, focusing on runtime errors and their management to maintain normal execution flow. It outlines the structure of try, catch, and finally blocks, as well as the distinctions between checked and unchecked exceptions. Additionally, it explains the concepts of 'throw' and 'throws' in exception handling, along with the final, finally, and finalize keywords.

Uploaded by

nitinsingh3264
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Exception Handling ->

Thursday, 3 July 2025 4:36 PM

Exception -> Unpredict error -> run time -> normal flow of execution khrb hojaeye

User Market

Petrol

Mechanism to handle run time error so that the normal flow of execution can be maintained

cart order

Tracking -> GPS ->


pay
Sorry for the error -> delvier
s

menu

track

Compiler ->

Python State 1
Node js State 2
State 3
State 4
State 5
State 6
Try{
State 7 // galat hai
}
Catch{
Syso -> "Sorry for the error"
}
Finally {
State 6
Try{
State 7 // galat hai
}
Catch{
Syso -> "Sorry for the error"
}
Finally {

}
State 8

Exception Handling ->

1. Checked
a. IO Exception , SQL Exception , ClassNotFound Exception
2. Unchecked ->
a. Arrayindexoutofbound , arthimetic 0/10 , String ; 0>

3. Error
a. Stackoverflow , NoClassDefine , outofMemoryError

Paise do ?
Ghar

Return kroge ->


User Charger le ana

Bike ->

To Handle Exception ->

1. Try Block -> jis part of code m apko lgtha hai error aa sakthi hai
2. Catch Block -> aagr try block wale code m error aati hai toh on the spot catch block trigger hojaega
3. Finally Block -> aagr error ho ya na ho -> finally block always executable hai

Throw Throws
When u want to throw exception Method signature -> Declare in method -> function -> throws
explicitly activate krde
Customized Galti , function , block ,
body
Throw Throws
When u want to throw exception Method signature -> Declare in method -> function -> throws
explicitly activate krde
Customized Galti , function , block ,
body

Final Finally Finalize


Final keyword Exception Method
Variable -> Whether try block consist After java 1.8 -> finalize deprecated ->
1. Reassign Of error or not -> finally will Garbage collector -> perform clean when
2. Kahi diff sub class always executed Object is of no use
3. Inc/dec nhi kr sakthe
4. Unchangable

You might also like