Victor Lyuboslavsky Victor Lyuboslavsky - 1 year ago 118
Java Question

How to use Java's lambda expressions to print an array?

How can I achieve the following array print using Java 8's lambda expressions?

int[] values = new int[16];
// Populate values

for (int value : values) {
System.out.println(Integer.toUnsignedString(value, 16));

Answer Source
      .mapToObj(i -> Integer.toUnsignedString(i, 16))
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download