Amazing info. Long awaited. Thanks a ton for taking the initiative. After Oracle took Java along with sun a lot of confusion followed with various version numbers. Perhaps now they can plan migration to higher levels ..
Double getArea() { return switch(this) { case Circle2(Double r) -> Math.PI * Math.pow(r, 2); case Squar2(Double l) -> l * l; default -> throw new IllegalArgumentException("Unexpected value: " + this); }; } when I try to do the same I get the following error: Cannot switch on a value of type Shape. Only convertible int values, strings or enum variables are permitted in the return switch parameter. I am using Java 17. LTS
56:10 you can, with --add-opens, but you shouldn't While I said that, the problem is that some API don't have the choice and the JDK doesn't offer a proper way to help them.
Always enjoy Simone's talks. Especially those on garbage collection. This man has so much experience and insight and can deliver it effectively.
Thanks a lot Simone Bordet
Many have given this talk, but this is the best one I have heard.
Very useful info, thanks.
Thanks a lot Simone for this awesome presentation 👏
Amazing content
Great talk.
Awesome presentation!
You are so right Simone, upgrade to newer versions is sooooooo super important ! dont let the technical debts destroy you !!!!!
Amazing info. Long awaited. Thanks a ton for taking the initiative.
After Oracle took Java along with sun a lot of confusion followed with various version numbers.
Perhaps now they can plan migration to higher levels ..
Double getArea() {
return switch(this) {
case Circle2(Double r) -> Math.PI * Math.pow(r, 2);
case Squar2(Double l) -> l * l;
default -> throw new IllegalArgumentException("Unexpected value: " + this);
};
}
when I try to do the same I get the following error: Cannot switch on a value of type Shape. Only convertible int values, strings or enum variables are permitted
in the return switch parameter.
I am using Java 17. LTS
i think it works in java 21
56:10 you can, with --add-opens, but you shouldn't
While I said that, the problem is that some API don't have the choice and the JDK doesn't offer a proper way to help them.
I wonder if he wants me to update from Java 8... he's not very clear on this
Newbie java developers won't understand the fun in coding with newer versions of Java until they have coded Java1.5 and below.
I don't think I would care when choosing a job which version of Java is used there. Never asked that question.