When 'var' Doesn't Work #java #shorts #coding #airhacks

preview_player
Показать описание

Java used in this short: openjdk version "21" 2023-09-19 LTS

#airhacks
Рекомендации по теме
Комментарии
Автор

You can use:

print(Map.<String, Integer>of());

mkrgl
Автор

I'm just never using `var`. It makes code unreadable in most cases, especially outside of IDE.

daripher
Автор

Introduced as "this will be used only in complex types in streams", but really used to make Java more similar to JavaScript - pretending, that you don't need to care about types 😔
It gave up the clarity of Java code.

petraubrecht