overriding methods without subclassing in Java

前端 未结 5 1960
时光取名叫无心
时光取名叫无心 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:18

    In this case the XStream class is an anonymous inner class. Then you're overriding the method of your anonymous XStream class.

提交回复
热议问题