Don't learn programming starting with Java, if you can at all help it. It's trash. Start either with a more user-friendly language like Python, or with something low-level like C++. Either one will teach you what you need (Python will be an easier transition, C++ will be throwing yourself in the lion's den but will help you learn important fundamentals first which will inform your later learning), and then you can move on to the archaic spaghetti dinosaur known as Java.
Also, LOL at all the C++ hate in this thread. C++ is fine, you just need to git gud. Most of its challenges are conceptual, not rote memorization of incongruous syntax and OOP implementations like Java.