Datasets:
ArXiv:
License:
Stack-Repo / data /train /akash-coded /FSD_Java /Lesson-3 /Exception Handling /Assisted Practice Problems /FinallyBlockDemo.java
Download data/train/akash-coded/FSD_Java/Lesson-3/Exception Handling/Assisted Practice Problems/FinallyBlockDemo.java from RepoFusion/Stack-Repo: direct link, hf CLI and curl.
- Browser
- Download file 379 Bytes
-
https://huggingface.co/datasets/RepoFusion/Stack-Repo/resolve/bbc90aef76314892f2d54f85da32b81503fb7eb3/data/train/akash-coded/FSD_Java/Lesson-3/Exception%20Handling/Assisted%20Practice%20Problems/FinallyBlockDemo.java
- Command line
-
hf download 'hf://datasets/RepoFusion/Stack-Repo@bbc90aef76314892f2d54f85da32b81503fb7eb3/data/train/akash-coded/FSD_Java/Lesson-3/Exception Handling/Assisted Practice Problems/FinallyBlockDemo.java'
-
curl -L -o FinallyBlockDemo.java https://huggingface.co/datasets/RepoFusion/Stack-Repo/resolve/bbc90aef76314892f2d54f85da32b81503fb7eb3/data/train/akash-coded/FSD_Java/Lesson-3/Exception%20Handling/Assisted%20Practice%20Problems/FinallyBlockDemo.java
379 Bytes
| public class FinallyBlockDemo { | |
| public static void main(String[] args) { | |
| int a = 45; | |
| int b = 0; | |
| int rs = 0; | |
| try { | |
| rs = a / b; | |
| } catch (ArithmeticException Ex) { | |
| System.out.print("\n\tError : " + Ex.getMessage()); | |
| } finally { | |
| System.out.print("\n\tThe result is : " + rs); | |
| } | |
| } | |
| } | |