Want everyone on your software team to learn this? Free 14-day trial.
Train my teamMemory-Safe Java Codetry {
String[] array = { "a", "b", "c" };
array[25] = "z";
}
catch (ArrayIndexOutOfBoundsException e) {
// Attempts to overflow the buffer will raise an error in Java.
e.printStackTrace();
}