You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+15Lines changed: 15 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -541,6 +541,21 @@ The super keyword in java is a reference variable that is used to refer parent c
541
541
542
542
**Code3:[superWithVariables.java](https://github.com/disha2sinha/Object-Oriented-Programming-in-Java/blob/master/Super%20keyword/superWithVariables.java):** A Program to illustrate how use of 'super' with data member of parent class can avoid ambiguity if derived class and parent class has same data members.
543
543
544
+
# EXCEPTION HANDLING:
545
+
546
+
An exception is an unwanted or unexcepted event,which occurs during the execution of a program ie. at run-time that disrupts the normal-flow of the program's execution.
**Code1:[ExceptionHandling1.java](https://github.com/disha2sinha/Object-Oriented-Programming-in-Java/blob/master/Exception%20Handling/ExceptionHandling1.java):** A java program to show three ways of printing exception msg using printStackTrace(),toString(),getMessage() methods of Throwable class.
555
+
556
+
**Code2:[ControlFlow1.java](https://github.com/disha2sinha/Object-Oriented-Programming-in-Java/blob/master/Exception%20Handling/ControlFlow1.java):** If a statement in try block raised an exception, then the rest of the try block doesn’t execute and control passes to the corresponding catch block. After executing the catch block, the control will be transferred to finally block(if present) and then the rest program will be executed.
557
+
558
+
**Code3:[ControlFlow2.java](https://github.com/disha2sinha/Object-Oriented-Programming-in-Java/blob/master/Exception%20Handling/ControlFlow2.java):** Java program to demonstrate control flow of try-catch-finally clause when exception occur in try block and handled in catch block.
0 commit comments