Datasets:
ArXiv:
License:
Stack-Repo / data /train /akash-coded /FSD_Java /Lesson-3 /Exception Handling /Examples /FinallyExample2.java
Download data/train/akash-coded/FSD_Java/Lesson-3/Exception Handling/Examples/FinallyExample2.java from RepoFusion/Stack-Repo: direct link, hf CLI and curl.
- Browser
- Download file 480 Bytes
-
https://huggingface.co/datasets/RepoFusion/Stack-Repo/resolve/bbc90aef76314892f2d54f85da32b81503fb7eb3/data/train/akash-coded/FSD_Java/Lesson-3/Exception%20Handling/Examples/FinallyExample2.java
- Command line
-
hf download 'hf://datasets/RepoFusion/Stack-Repo@bbc90aef76314892f2d54f85da32b81503fb7eb3/data/train/akash-coded/FSD_Java/Lesson-3/Exception Handling/Examples/FinallyExample2.java'
-
curl -L -o FinallyExample2.java https://huggingface.co/datasets/RepoFusion/Stack-Repo/resolve/bbc90aef76314892f2d54f85da32b81503fb7eb3/data/train/akash-coded/FSD_Java/Lesson-3/Exception%20Handling/Examples/FinallyExample2.java
480 Bytes
| /** | |
| * Let's see the java finally example where exception occurs and not handled. | |
| */ | |
| public class FinallyExample2 { | |
| public static void main(String args[]) { | |
| try { | |
| int data = 25 / 0; | |
| System.out.println(data); | |
| } catch (NullPointerException e) { | |
| System.out.println(e); | |
| } finally { | |
| System.out.println("finally block is always executed"); | |
| } | |
| System.out.println("rest of the code..."); | |
| } | |
| } | |