I’m not going to rehash any of the billions of web pages out there about Java. I just want to summarize some of my thoughts on it.
I am perfectly willing to work in Java if somebody pays me too, and I am even Oracle certified in Java, but I have some criticisms of the language.
It’s not possible in Java even to define inner functions for the sake of dividing a complex method into small subroutines. Each of those small subroutines must itself be a method on an object. This causes people to write a lot of small private methods to serve that purpose, which is an anti-pattern in my opinion. A subroutine or a helper function is not the same thing as a private method.
More recently Java has been trying to make it easier to write something sort of like anonymous first class functions. It’s still super tedious in Java. I stand by that. But since I’m not really an expert on recent developments in java, I don’t want to talk further on that topic, or on lambda expressions.
Java is not really and truly object oriented. Java contains classes. A “class” in Java is not just an abstract language construct. A class is a thing, like an object but not an object. A class can store data. A class is a singleton. Basically a class is a singleton instance of a very special kind of object. The thing that makes a Java class into a singleton object and not just a language construct is that classes can store data inside static fields. A static, non-constant field on a class is basically a global.
Java is way too verbose. You constantly have to repeat data types, over and over.
If you are brand new to programming and you are trying to develop basic skills to make yourself marketable in the workplace, you might just be asking: “should I learn Java?” A broad, open-ended question that pretends to have a simple yes or no answer.
Ultimately, for now, I think the answer is simply “yes”. Java doesn’t have to be your first language. It doesn’t have to be your best language. But yes, for now, every software engineer of any style should know some Java. Anyone aiming to be a web developer for sure should learn Java because it is so heavily used for backend web development, especially using the Spring framework. Also Java is very similar to C#, which is also quite popular. Knowing Java will help you understand C# if your career takes you in that direction. So, yes, learn some Java.