variable of type horse if refers to an actual object of type equestriancan it be cast to the class racerwhy or why notr- give an example of java code fragment that performs an array reference that is possibly out of boundsand if it is out of boundsthe program catches that exception and prints the following error message"don' try buffer overflow attacks in java! - consider the following code fragmenttaken from some packagepublic class maryland extends state maryland(/null constructor *public void printme(system out println("read it ")public static void main(string[argsregion mid new state()state md new maryland()object obj new place()place usa new region()md printme()mid printme()((placeobjprintme()obj md((marylandobjprintme()obj usa((placeobjprintme()usa md