 In Java, if accessing an array out of bounds, an exception will be thrown.Examples of other safe languages are C#, Haskell and Scala.During compilation of an unsafe language run-time checks is added to the low-level code to detect source-level undefined behavior.