Faced with the phenomenon:
public class MenuIndexException extends ArrayIndexOutOfBoundsException { public MenuIndexException(String massage) { super(massage); } public void answer() { } } Why doesn't this record work? Polymorphism for exception classes does not work? Or am I somehow not applying it correctly?
ArrayIndexOutOfBoundsException ex = new MenuIndexException("s"); ex.answer(); Do not want to compile the idea immediately underlines the red ... Why? although I equated to the ex = new MenuIndexException , I still do not have a method that is in this class ...