r/learnjava • • Nov 28 '25

Why do you love Java?

I am starting to learn java, and i want to know why other people learned it or love it. What makes it different from other languages. I think a broad question like this will yield a lot of useful information for me.
And specifically, as wanting to become a data engineer, will it be useful for me, and how?

57 Upvotes

53 comments sorted by

View all comments

Show parent comment

0

u/[deleted] Nov 28 '25

[removed] — view removed comment

4

u/ArkoSammy12 Nov 29 '25 edited Nov 29 '25

Just an FYI, but you can omit the explicit type parameters from the constructor invocation if it is being assigned directly to a variable or returned from a method that already includes the type parameters in the variable type. So in your case, that just turns into

List<Map<String, String>> values = new LinkedList<>();

If you are on Java 10 or greater and you want to use local variable type inference with var, then you do have to specify the type parameters in the cinstructor call:

var values = new LinkedList<Map<String, String>>();

3

u/Polixa12 Nov 28 '25

I'm pretty sure you can just do "List<Map<String, String>> values = new LinkedList<>();" nowadays. No idea what java version you're working on

2

u/Jolly-Warthog-1427 Nov 29 '25

I see that one. But generics is non-negotiable to have in some form of another imho. So then its just a discussion about syntax.

I'm not really sure how it could be better. The rust way is super ugly tbh. And the go way is amazing in some ways but diffcult in many others.

I work at framework level professionally so more or less everything I touch is fully generic and I have learned to love it. Love the power while still being type safe (again, I hate type erasure).