Datasets:
ArXiv:
License:
Stack-Repo / data /train /akash-coded /FSD_Java /Lesson-3 /Exception Handling /Examples /JavaExceptionExample.java
Download data/train/akash-coded/FSD_Java/Lesson-3/Exception Handling/Examples/JavaExceptionExample.java from RepoFusion/Stack-Repo: direct link, hf CLI and curl.
- Browser
- Download file 575 Bytes
-
https://huggingface.co/datasets/RepoFusion/Stack-Repo/resolve/bbc90aef76314892f2d54f85da32b81503fb7eb3/data/train/akash-coded/FSD_Java/Lesson-3/Exception%20Handling/Examples/JavaExceptionExample.java
- Command line
-
hf download 'hf://datasets/RepoFusion/Stack-Repo@bbc90aef76314892f2d54f85da32b81503fb7eb3/data/train/akash-coded/FSD_Java/Lesson-3/Exception Handling/Examples/JavaExceptionExample.java'
-
curl -L -o JavaExceptionExample.java https://huggingface.co/datasets/RepoFusion/Stack-Repo/resolve/bbc90aef76314892f2d54f85da32b81503fb7eb3/data/train/akash-coded/FSD_Java/Lesson-3/Exception%20Handling/Examples/JavaExceptionExample.java
575 Bytes
| public class JavaExceptionExample { | |
| public static void main(String args[]) { | |
| try { | |
| // code that may raise exception | |
| int data = 100 / 0; | |
| System.out.println("Value of data: " + data); | |
| } catch (ArithmeticException e) { | |
| System.out.println(e); | |
| } | |
| // rest code of the program | |
| System.out.println("rest of the code..."); | |
| } | |
| } | |
| // try{ | |
| // code that may throw an exception | |
| // }catch(Exception_class_Name ref){ | |
| // ... | |
| // } | |
| // try{ | |
| // code that may throw an exception | |
| // }finally{ | |
| // ... | |
| // } |