The java interface should not be instantiated, why is it possible in the following form?

the java interface should not be instantiated, so why make the program work properly in the following form?
(the screenshot on the ebook, the program actually clicked, but I don"t know why)
clipboard.png

Sep.16,2021

this is the way to write an anonymous inner class. After the java file is compiled, an inner class implementation interface is generated

final class TestDemo$1
  implements IMessage
{
  public void print()
  {
    
  }
}
Menu