Overriding a method in an instantiated Java object

前端 未结 9 1420
陌清茗
陌清茗 2021-02-05 01:55

I would like to override a method in an object that\'s handed to me by a factory that I have little control over.

My specific problem is that I want to override the

9条回答
  •  遥遥无期
    2021-02-05 02:13

    Using a decorator is the right way to go:

    Some very similar code to the requirement you have with sockets is here:

    http://www.javaspecialists.eu/archive/Issue058.html

提交回复
热议问题