Is there a way to avoid loops when adding to a list?

后端 未结 0 1029
后悔当初
后悔当初 2021-02-11 19:06

I was wondering a code like this:

List list = new ArrayList();
for(CustomObject co : objects) {
    list.add(co.getActualText());
}         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题