Topic: try-catch
Example:
Output: SDU
But what happens if we change the code as below:
It is an error, because string name goes outside the boundary.
So for such cases we use try and catch.
Now the output for this code is: error
If we want to see what that error is about, then we add “exception” keyword as below:
Output:
Then another special function is “final” which will tell you when the program execution finishes.
Output:
Topic: Methods
Example-1:
Example-2:
Example-3:
Example-4:
Output:
Example-5:
Переглядів: 196 |