「Java8」Lambda式で既存メソッドを呼び出すサンプル

Javaコード

package com.arkgame.study;

import java.util.Arrays;
import java.util.List;

public class LambaDemo {

	public static void main(String[] args) {
		List<String> city = Arrays.asList("tokyo", "oosaka", "fukuoka", "yokohama", "kawasaki");
		city.forEach(System.out::println);

	}

}

結果
tokyo
oosaka
fukuoka
yokohama
kawasaki

Java

Posted by arkgame