Datasets:
ArXiv:
License:
Stack-Repo / data /train /akash-coded /FSD_Java /Lesson-3 /Exception Handling /Assisted Practice Problems /TryCatchStatements.java
Download data/train/akash-coded/FSD_Java/Lesson-3/Exception Handling/Assisted Practice Problems/TryCatchStatements.java from RepoFusion/Stack-Repo: direct link, hf CLI and curl.
- Browser
- Download file 382 Bytes
-
https://huggingface.co/datasets/RepoFusion/Stack-Repo/resolve/bbc90aef76314892f2d54f85da32b81503fb7eb3/data/train/akash-coded/FSD_Java/Lesson-3/Exception%20Handling/Assisted%20Practice%20Problems/TryCatchStatements.java
- Command line
-
hf download 'hf://datasets/RepoFusion/Stack-Repo@bbc90aef76314892f2d54f85da32b81503fb7eb3/data/train/akash-coded/FSD_Java/Lesson-3/Exception Handling/Assisted Practice Problems/TryCatchStatements.java'
-
curl -L -o TryCatchStatements.java https://huggingface.co/datasets/RepoFusion/Stack-Repo/resolve/bbc90aef76314892f2d54f85da32b81503fb7eb3/data/train/akash-coded/FSD_Java/Lesson-3/Exception%20Handling/Assisted%20Practice%20Problems/TryCatchStatements.java
382 Bytes
| public class TryCatchStatements { | |
| public static void main(String args[]) { | |
| int[] array = new int[3]; | |
| try { | |
| array[7] = 3; | |
| } catch (ArrayIndexOutOfBoundsException e) { | |
| System.out.println("Array index is out of bounds!"); | |
| } finally { | |
| System.out.println("The array is of size " + array.length); | |
| } | |
| } | |
| } | |