Tim Moores wrote:
Thomas Roth wrote:Once is was enthusiastic about java certification. I still think the idea is great, but if the Exam creators don't change direction i think it will loose relevance, at least here in germany.
I've worked in the UK, Germany and the US for numerous companies, and I've never come across a situation where any Java exam was valued. It's an insignificant indication that an applicant may have some skill of interest, but the interview process will test the relevant ones in much more detail anyway. Obviously, that's anecdotal evidence, but I advise anyone considering spending time and money on this to ask themselves if there are maybe better ways of preparing for a tech career.
Mike Simmons wrote:
Neither do methods of PrintWriter. The constructors of both PrintStream and PrintWriter throw IOException, but the methods do not.
Mike Simmons wrote:
Note that you can connect a PrintWriter to an OutputStream, but you can't connect a PrintStream to a Writer. So far.
Anil Philip wrote:I am trying to understand the difference between the PrintStream and PrintWriter.
I see that they have identical methods.
Stephan van Hulst wrote:
Paul Anilprem wrote:But even a static method can't be marked final in an interface! One can only guess why.
What would it even mean for a static interface method to be final? Static interface methods aren't inherited in the first place.
Mike Simmons wrote:
With this method, how would you ever get a V instance at all? You have a stream of T, and you have a BiFunction to take a V and a T, and return a V. Which means you need at least one V to use that function. That's why you need an identity V instance, to start the reduction off.
Mike Simmons wrote:
And for parallel processing, each worker thread will use that same identity V instance to start off processing its own subset of elements, before combining later with the combiner. And if any of those worker threads finds there are no elements for them to process (maybe it turns out that there's a filter() method that eliminates all the elements that might have been expected) you want the worker to not freak out and throw an exception, just return the identity value unmolested, so it can still be combined with the other results safely.
Campbell Ritchie wrote:
Another reason, maybe, for not throwing exceptions from an empty Stream is that exceptions are supposed to respond to something abnormal, and an empty Stream is regarded as a normal occurrence.
Paul Anilprem wrote:
Campbell Ritchie wrote:Isn't that what happens if you use the method without the identity parameter?
No, the one that doesn't take identity parameter takes one parameter of type BinaryOperator. A BinaryOperator restricts you to returning the same type as the type of the stream.
In fact, now I wonder why did they not design this method to accept a BiFunction like the other reduce method.
Campbell Ritchie wrote:Isn't that what happens if you use the method without the identity parameter?
Campbell Ritchie wrote:
The reason for not throwing an exception is that the designers didn't want Streams to fail to complete their runs.