java forEach method

www‮ruttual.‬i.com
java forEach method
/**
 * @author lautturi.com 
 * Java example:  java forEach method
 */

import java.util.*;

public class Lautturi {

	public static void main(String[] args) {

		List<Integer> numbers = Arrays.asList(1, 2, 3, 4, 5, 6);
		
		numbers.forEach(value -> 
			System.out.print(value+ " "));

	}
}

output:

1 2 3 4 5 6
Created Time:2017-09-23 20:50:18  Author:lautturi