Java, version 8, introduced functional programming, with lambda functions. The lambda expression can infer the type of its formal parameters. Consider the following code:
Consumer<String> consumer = (String s) -> System.out.println(s);
Instead of the preceding code, you could type the following code:
Consumer<String> consumer = s -> System.out.print(s);