This article is an example of Java 8's functional style programming compared to pre Java 8 code. The code is run from Java 9's JShell REPL tool. There is also code of this example using a real functional programming language. Here is the link to the article...
That's an interesting article Please explain what JShell is. Is it some sort of interpreter where you can enter a bit of code and have it interpreted directly? Does JShell help with developing and testing code.
I shall add this discussion to the “new features” fora in the hope of more people reading it.
JShell is a new Java feature with Java 9, which was released recently. I only downloaded Java 9 couple of days back and started using it (for this post), and I found JShell quite easy to use and useful. I haven't explored it yet to make any comments other than what's mentioned in my post. As you had mentioned its a sort of interpreter where one can enter a bit of code (declarations, statements, and methods) and have it interpreted directly. It helps developing and testing code quickly.
I thought it would be interesting to use the JShell in my post though its not part of Java 8. The Haskell functional programming has a similar REPL (Read-Evaluate-Print Loop) tool, and its been there since the very earlier versions of Haskell language (how early, I see it sometime before year 2000). I have been learning Haskell for couple of months, since I got my Java 8 certification recently. I found the functional programming concepts interesting and kind of randomly selected Haskell to know more about a functional programming language. The Haskell's GHCi REPL tool is very useful while learning Haskell and I got this idea to use in the post.
I have been learning Haskell for couple of months, I somehow feel 'nice' to know about the language (just a feeling). I also am enjoying learning Haskell as I don't have particular goals about it. Its easy to grasp the language if one knows the functional-style programming of Java 8. There are quite a few features in Java which can be related to Haskell like, lambdas, streams, filter/map/reduce functions, something like interfaces, stateless functional programming, generic types, data types, data structures (like lists, sets and maps),... But, getting used to functions, one has to persist. And moreover there is no for loop in Haskell and values cannot be reassigned to a variable.
I think knowing a real functional programming gives a deeper insight into the Java 8's functional-style features.
There are a lot of online material to learn Haskell; I started with the following and these definitely are a good starting point, for anyone who chooses.
I guess learning the basics of Haskell years ago as helped with my Java skills; never thought I would say this. I haven't used Haskell since then, but with the functional style being imported into Java 8, I would have to.
Programming in Haskell, by Graham Hutton is another book I referred to recently. It's more like an academic text book (if someone likes that style) with exercises at end of each chapter. The second edition has the recent version of Haskell is good for learning.
The inputString.split(" ") method returns an array of strings. This is same as: String  result = inputString.split(" ");
In the example, any of the two methods usage returns the same output. But, there are some differences in the two methods. Here are the definitions of the two stream methods and examples.
static <T> Stream<T> of(T... values) Returns a sequential ordered stream whose elements are the specified values.
static <T> Stream<T> stream(T array) Returns a sequential Stream with the specified array as its source.
Note that the method Arrays.Stream method is overloaded to take various primitive arrays or a type array to return streams as in the examples above. These methods are capable of returning primitive streams (e.g., IntStream). Arrays class also has variations of this method to select a range of elements from the input array to create the stream.
Both the method versions return sequential streams. But, the Stream class's method input must be an object type as input, and the following code will not compile on line 2:
Also, note that in the first version the stream method allows varargs as its arguments. This allows elements, as shown in the above version one example, can be entered without creating an array explicitly.
And why did you choose one over another in your blog post?
I really don't recollect why I did that. I think it means same output in this case.