JDK8 list对象循环

 // JDK8 之前
      for (FlightOrderTicket flightOrderTicket : tickets) {
            	   names.append(flightOrderTicket.getName()).append(",");
			  }

// JDK 8  
tickets.subList(0, tickets.size()).forEach(a -> {
			names.append(a.getName()).append(",");
		});

    原文作者:浮云若水
    原文地址: https://blog.csdn.net/a276202031/article/details/78731880
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞