An array is created with a certain number of locations, numbered from zero up to some specified maximum index. It is an error to try to use an array location that is outside of the specified range. In Java, any attempt to do so is detected automatically by the system. Since there is no telling what that memory location is being used for, the result will be unpredictable. The consequences could be much more serious than a terminated program.
Pointers are a notorious source of programming errors.
In Java, a variable of object type holds either a pointer to an object or the special value null . Any attempt to use a null value as if it were a pointer to an actual object will be detected by the system. In some other languages, again, it's up to the programmer to avoid such null pointer errors. In my old Macintosh computer, a null pointer was actually implemented as if it were a pointer to memory location zero. A program could use a null pointer to change values stored in memory near location zero.