Robert Friml

+ Follow
since Feb 22, 2016
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Robert Friml

Hello Teo,
OK, maybe not errata exactly...
With correct class definition and imports I agree. But it is still a bit confusing to assume that method definition throws checked exception. This way I could assume lots of things.

Best regards, Robert
Hey there,

One errata I guess. 3rd review question in chapter 7, I thing D is also correct answer: Line w4 causes compile time error. Future's get() method may throw checked exception and it is not handled, nor declared anywhere in the code.

Best regards, Robert.
Hello Fabio,

problem here is, that you are using raw type: But you should really use: This would produce compile time error.

What happens in your case is what you actually mentioned - Comparable takes any Object and then at runtime it fails to cast that Object into your desired one.

In your example concrete type is infered from the first parameter - Float. And Float class has its compareTo method defined as follows: which obviously fails cast Long to Float.

Hope this helps and is correct
Best regards, Robert.
Hello guys,

one typo. In summary of chapter 4 in Optional paragraph there should be getAsDouble(), getAsInt(), getAsLong() as method names.
I think it's nicely constistent with the rest of the new API - IntSupplier for instance. Just the way I remember it ;-)

Kind regards, Robert.

in table 3.12 1st row - key has null value and mapping function returns null - merge function will associate new value with that key (mapping function isn't even called), won't remove it. Right?