overriding methods without subclassing in Java

前端 未结 5 1929
时光取名叫无心
时光取名叫无心 2021-01-02 05:41

I started on a new project recently and saw the usage of overriding like below for the first time.

public class SomeClass {
  public void myMethod() {
    XS         


        
5条回答
  •  伪装坚强ぢ
    2021-01-02 06:15

    That is called an "Anonymous class". You can find a lot of documentation about this special syntax on Internet. Good luck.

提交回复
热议问题