问题:
I am looking to implement a functionality in a list of object as I would in C# using an extension method.我希望在对象列表中实现功能,就像在C#中使用扩展方法一样。
Something like this:像这样的东西:
List<DataObject> list;
// ... List initialization.
list.getData(id);
How do I do that in Java?我该如何在Java中做到这一点?
解决方案:
参考一: https://en.stackoom.com/question/IIEF参考二: https://stackoom.com/question/IIEF