Datasets:
ArXiv:
License:
Stack-Repo
/
data
/train
/akash-coded
/FSD_Java
/Lesson-3
/Exception Handling
/Assisted Practice Problems
/TryCatchStatements.java
| 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); | |
| } | |
| } | |
| } | |