Datasets:
ArXiv:
License:
Stack-Repo / data /train /akash-coded /FSD_Java /Lesson-3 /Exception Handling /Examples /ThrowsExample2.java
Download data/train/akash-coded/FSD_Java/Lesson-3/Exception Handling/Examples/ThrowsExample2.java from RepoFusion/Stack-Repo: direct link, hf CLI and curl.
- Browser
- Download file 380 Bytes
-
https://huggingface.co/datasets/RepoFusion/Stack-Repo/resolve/bbc90aef76314892f2d54f85da32b81503fb7eb3/data/train/akash-coded/FSD_Java/Lesson-3/Exception%20Handling/Examples/ThrowsExample2.java
- Command line
-
hf download 'hf://datasets/RepoFusion/Stack-Repo@bbc90aef76314892f2d54f85da32b81503fb7eb3/data/train/akash-coded/FSD_Java/Lesson-3/Exception Handling/Examples/ThrowsExample2.java'
-
curl -L -o ThrowsExample2.java https://huggingface.co/datasets/RepoFusion/Stack-Repo/resolve/bbc90aef76314892f2d54f85da32b81503fb7eb3/data/train/akash-coded/FSD_Java/Lesson-3/Exception%20Handling/Examples/ThrowsExample2.java
380 Bytes
| import java.io.*; | |
| class N { | |
| void method() throws IOException { | |
| throw new IOException("device error"); | |
| } | |
| } | |
| /** | |
| * Case2: You declare the exception | |
| */ | |
| public class ThrowsExample2 { | |
| public static void main(String[] args) throws IOException {// declare exception | |
| N n = new N(); | |
| n.method(); | |
| System.out.println("normal flow..."); | |
| } | |
| } | |