Datasets:
ArXiv:
License:
Stack-Repo / data /train /akash-coded /FSD_Java /Lesson-3 /Exception Handling /Examples /TryCatchExample2.java
Download data/train/akash-coded/FSD_Java/Lesson-3/Exception Handling/Examples/TryCatchExample2.java from RepoFusion/Stack-Repo: direct link, hf CLI and curl.
- Browser
- Download file 417 Bytes
-
https://huggingface.co/datasets/RepoFusion/Stack-Repo/resolve/bbc90aef76314892f2d54f85da32b81503fb7eb3/data/train/akash-coded/FSD_Java/Lesson-3/Exception%20Handling/Examples/TryCatchExample2.java
- Command line
-
hf download 'hf://datasets/RepoFusion/Stack-Repo@bbc90aef76314892f2d54f85da32b81503fb7eb3/data/train/akash-coded/FSD_Java/Lesson-3/Exception Handling/Examples/TryCatchExample2.java'
-
curl -L -o TryCatchExample2.java https://huggingface.co/datasets/RepoFusion/Stack-Repo/resolve/bbc90aef76314892f2d54f85da32b81503fb7eb3/data/train/akash-coded/FSD_Java/Lesson-3/Exception%20Handling/Examples/TryCatchExample2.java
417 Bytes
| /** | |
| * Let's see the solution of the Example-1 problem by a java try-catch block. | |
| */ | |
| public class TryCatchExample2 { | |
| public static void main(String[] args) { | |
| try { | |
| int data = 50 / 0; // may throw exception | |
| } | |
| // handling the exception | |
| catch (ArithmeticException e) { | |
| System.out.println(e); | |
| } | |
| System.out.println("rest of the code"); | |
| } | |
| } |