Skip to content

Instantly share code, notes, and snippets.

@oliverjumpertz
Created January 19, 2017 19:57
Show Gist options
  • Save oliverjumpertz/ae781a5898ce6451f50e1e775064e161 to your computer and use it in GitHub Desktop.
Save oliverjumpertz/ae781a5898ce6451f50e1e775064e161 to your computer and use it in GitHub Desktop.
package de.oliver;
import javaslang.collection.List;
public class SquareOfNumberCalculator {
public static void main(String[] args) {
final List<Integer> myList = List.range(1, 6);
final List<Integer> squaredNumbers = myList.map(i -> i * i);
System.out.println("Printing original numbers");
myList.forEach(i -> System.out.println(" i --> " + i));
System.out.println("Printing squared numbers");
squaredNumbers.forEach(i -> System.out.println(" i --> " + i));
}
}
@oliverjumpertz
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment