How can I call a method on each element of a List?

前端 未结 6 1068
太阳男子
太阳男子 2020-12-09 14:41

Suppose that I have a list of cars :

public class Car {
    private String brand;
    private String name;
    private String color;

    public Car() { // .         


        
6条回答
  •  感情败类
    2020-12-09 15:18

    If you are stuck and must still use Apache Commons then the Transformer class can be of help: http://apachecommonstipsandtricks.blogspot.de/2009/01/examples-of-functors-transformers.html

提交回复
热议问题