Please turn JavaScript on

Randomthoughtsonjavaprogramming

Is this your feed? Claim it!

Publisher:  Unclaimed!
Message frequency:  0.75 / week

Message History

So I've been trying to make a Map from a List in Kotlin, and as I have not much experience with Kotlin and not much experience with Maps, I turn to the Internet.

Funnily enough, after getting it working, my IDE keeps giving me subtle hints that it can be shorter and more concise.

I thought it would be nice to put the steps here.

style="color: rgb(68, 6...

Read full story

Kotlin lambdas are fully compatible with Java functional interfaces.

But sometimes you need to give Kotlin a little nudge, using a SAM constructor.

SAM constructors (Single Abstract Method) allow you to convert a lambda expression to an instance of a functional interface. The syntax is pretty straightforward.

FunctionalInterfaceName { lambda_function }

...

Read full story

So, I've suddenly recently noticed that whenever I commit a change into Git in IntelliJ that contains a conversion of a .java file into a .kt (Kotlin) file, IntelliJ will automatically make a previous commit containing the comment "Rename .java to .kt" which contains ONLY the renaming of the file.

I thought this was odd, but the reason behind it is that this com...

Read full story
JFall 2025

href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbd31zvnSeNzVdFcMYOBc2RlFDQORrRoO5PDwL76YG_we4WdO8bMcHAKpldD0PhyphenhyphenBNWjkEQ707ox0Hi8t9RvO2DuxnxgrSS4g8bpr4SO7gSabB9tgZI-01PzoFRPwMfVSFamw5Nef0djcQ/s1600/-var-www-org.nljug-current-application-assets-media-uploads-2015-06-17-jfall2015_v41.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: ...

Read full story

So I was wondering what my opinion is about that.

I don't like it a lot, as now it seems like calling a constructor looks similar to calling a method.

The only difference that's visible is that the constructor begins with a capital, and then only if you properly follow the coding style guidelines.

I noticed that where Java prefers clarity of purpose, Kot...

Read full story