Since the method
Stream.of(T... values)
includes the case of a single element, why is the method:
Stream.of(T t)
also included in the API? What's its purpose? When is it invoked? Does it do anything different from the varargs version?
Since the method
Stream.of(T... values)
includes the case of a single element, why is the method:
Stream.of(T t)
also included in the API? What's its purpose? When is it invoked? Does it do anything different from the varargs version?
What's its purpose?
A small improvement in efficiency for a common use case.
When is it invoked?
When you have one argument.
Does it do anything different from the varargs version?
The out come is the same, but it creates less garbage.