I think that learning the language is not difficult. In fact, I used to be a full time C++ developer, and at some point I started writing Java code. But the thing is that I don't remember ever learning Java, so I guess I just figured it as I went. I've been doing full time Java for a long time now.

If you are well familiar with C++, you may want to read a list of the major differences (e.g., everything is dynamically-bound) and then start practicing on an environment (just download Eclipse). The small differences are the main thing you would have to get adjusted to.

Now that Java supports generics, one of the major switching pains is gone. Multiple inheritance, while not supported, is not a big deal if you get used to interfaces, and in fact having interfaces rather than abstract classes with pure virtual functions (PVFs) improves readability.

To me Java is a nice and friendly and relaxing sandboxed version of C++. I don't have to worry about general protection faults (GPFs), I don't have to worry about memory leaks, I don't have to worry about messing with pointers. However, don't let that confuse you, there are still plenty of opportunities to screw up royally, and they're sometimes even nastier to detect.

Just take the leap. If you have the instinct, it shouldn't be a problem.

Answer from Uri on Stack Overflow
Top answer
1 of 16
24

I think that learning the language is not difficult. In fact, I used to be a full time C++ developer, and at some point I started writing Java code. But the thing is that I don't remember ever learning Java, so I guess I just figured it as I went. I've been doing full time Java for a long time now.

If you are well familiar with C++, you may want to read a list of the major differences (e.g., everything is dynamically-bound) and then start practicing on an environment (just download Eclipse). The small differences are the main thing you would have to get adjusted to.

Now that Java supports generics, one of the major switching pains is gone. Multiple inheritance, while not supported, is not a big deal if you get used to interfaces, and in fact having interfaces rather than abstract classes with pure virtual functions (PVFs) improves readability.

To me Java is a nice and friendly and relaxing sandboxed version of C++. I don't have to worry about general protection faults (GPFs), I don't have to worry about memory leaks, I don't have to worry about messing with pointers. However, don't let that confuse you, there are still plenty of opportunities to screw up royally, and they're sometimes even nastier to detect.

Just take the leap. If you have the instinct, it shouldn't be a problem.

2 of 16
9

I went the opposite way. Started with Java, then moved to C and C++. For my own personal experience, it was much easier to learn Java than C/C++ (C++ especially).

Java in many ways is meant to be C++ with many of the undefined and unnecessarily complicated portions removed or simplified. IMHO, it had great success with that goal. As a result it's a very easy language to learn and use. Especially for someone who is familiar with C++.

The actual time it will take is very dependent upon the person learning the language. However, I think it's safe to say it will take less time to become competent in Java than it did in C++.

🌐
Programiz PRO
programiz.pro › resources › time-to-learn-java
How Long Does It Take to Learn Java?
August 23, 2023 - Out of many factors, here are the ... to learn Java: ... Let's talk about each factor briefly. Your prior programming experience significantly impacts your learning time. It also makes the learning process a whole lot easy. For example, if you are from another programming language, say C++, you already know most programming ...
Discussions

Realistically how long does it take to learn Java?

Professional for 10 years, still learning every day!

More on reddit.com
🌐 r/java
38
21
August 11, 2016
How Long Does it Take to Learn Java for a Complete Newbie? - Stack Overflow
I have absolutely no programming experience but need to learn Java - enough to take a J2ME fasttrack course. I only have 10 weeks. Can I do this? What's your advice about the best resources I can u... More on stackoverflow.com
🌐 stackoverflow.com
How long will I need to learn Java, if I already know C/C++? Or how difficult is it?
An hour, or 10 years. Just depends on you. No one can answer how good you are at coding. I can learn a new language in a day or maybe a week, but I've been doing it forever. It's all basically the same to me now. More on reddit.com
🌐 r/AskProgramming
13
0
February 27, 2025
What are some ways to learn C++ if I know Java?

I started with Java, but when I tried learning C++ I got really caught up with the concept of pointers. Turns out, Java uses pointers all the time -- they're just called references in Java. The main difference I see with C++ is that you're not forced to allocate every object on the heap (using new), but you can allocate them on the stack like any normal primitive.

Some things you need to get used to are headers. In Java, you define your class and the implementation of that class in the same file. In C++ the definition of the class goes in the header, and the implementation of the functions goes in the .cpp file.

You should also read up on the preprocessor. All the statements that start with # (#include, #define, #if, etc) are preprocessor macros. They are executed at compile-time (or actually before compile-time) and not run time. They are used to transform the code before it's run through the compiler.

In terms of actually compiling, a standard Makefile is good to get your project up and running. I see most projects using cmake, but TBH I don't do enough large-scale C++ to know how to get that set-up.

For your development environment, linux is your development environment. It's like the whole OS is an IDE. You can also develop directly on Windows with Visual Studio, but I prefer to use WSL. You don't have to deal with a VM or dual booting, and you can access a (mostly) full linux environment through a terminal right within Windows. I tend program directly in VS Code and then use the WSL terminal to compile and run the program. Software made this way will not directly run on windows (unless you code with mingw in mind), but they will run on linux and WSL (for me, running in WSL is essentially running on windows).

You should also be aware of all the versions of C++ out there (c++98, c++03, c++11, ...). The newer ones support the features that people call "modern" C++ -- smart pointers for example. I've heard a lot of people say you shouldn't really use raw pointers (the *'s), and should only use smart pointers. I've also heard you shouldn't use 'new' but I'm not too sure what their alternative is.

Just keep in mind which C++ features are "modern" and which are not. For example, you shouldn't use old-style casting (c-style casting, like in Java, with parentheses), but instead use the in-build static_cast, dynamic_cast.

Also to keep in mind is in Java, you don't really care about memory management -- everything (for the most part) works out. But in C++ you need to decide if you want to allocate on the stack or on the heap. If you allocate on the stack that's static memory allocation, and the heap is dynamic memory allocation. As a rule of thumb, I try to do almost everything on the stack or use pre-allocated memory, and try to avoid using the heap at all costs (there are exceptions). For reference, all objects in Java use the heap. In C++, you have the choice of using the heap or not.

Exceptions are a lot different in C++ than in Java. They are 'expensive' and generate a lot of code (from what I've read and heard), and aren't as nice (IMO) as Java's exceptions. You can do some research on them and decide for yourself, but from what I've seen, the usual way to handle errors, and the way errors are handled in linux, is that the return value of a function is -1 (usually, it depends on the function, read the manpages for an exact description of each system call) on error.

There are a few things I've forgotten to mention, but this should give you a good idea of what you're getting into. C++ and Java have a lot of similarities, but also a lot of differences. You should feel pretty comfortable coming from Java to C++ if you keep in mind what I've mentioned. The syntax is mostly similar but the way things work can be pretty different, especially when it comes to memory.

Disclaimer: I am a Java developer by profession, C++ by hobby.

For references, use
The manpages: http://man7.org/linux/man-pages/index.html
cppreference: https://en.cppreference.com/w/
stackoverflow

More on reddit.com
🌐 r/cpp_questions
20
17
June 6, 2019
🌐
Quora
quora.com › How-long-would-it-take-me-to-learn-Java-if-I-already-know-C++-completely
How long would it take me to learn Java if I already know C++ completely? - Quora
Originally Answered: If I know C++, how long it would take to learn Java? · · It took me a summer to learn Java, after using C++ for 4–5 years. Java is mostly a subset of C++ (no multiple inheritance, no operator overloading, no pointers ...
🌐
Design Swan
designswan.com › home › how long does it take to learn java?
How Long Does it Take to Learn Java? - Design Swan
August 8, 2022 - Some experts suggest a period of 1-3 months for persons with prior knowledge of a programming language like C++, while some experts think beginners can learn Java in 2 – 6 months.
🌐
Coursera
coursera.org › coursera articles › computer science and engineering › how long does it take to learn java?
How Long Does It Take to Learn Java? | Coursera
November 24, 2025 - The amount of time it takes you to learn Java can range from a few hours to one year or more. This will depend on a lot of factors such as prior knowledge, how much Java you wish to learn, and your learning style.
🌐
Quora
quora.com › How-long-will-it-take-me-to-learn-C-if-I-know-Java-really-well
How long will it take me to learn C if I know Java really well? - Quora
Answer (1 of 8): You can learn basic c programming in at least 5 days if you know about programming as you mentioned you know java really well. c language do not support object-oriented concepts. you have half learning in c than java.
🌐
CodingNomads
codingnomads.com › blog › how-long-does-it-take-to-learn-java
How Long Does it Take to Learn Java?
This blog covers: How long does it take to learn Java? On average, it takes 4-12 months to learn Java from core Java basics to professional Java developer.
Find elsewhere
🌐
General Assembly
generalassemb.ly › home › how long does it take to learn java? a comprehensive guide to help you stay on track
How long does It take to learn Java? A comprehensive guide to help you stay on track - General Assembly
August 22, 2024 - Depending on your level of experience, learning Java can take as little as one to three months. However, if you’re starting from scratch, it might take more like six to nine months to really become confident in your Java skills.
🌐
Quora
beginnercoder.quora.com › How-long-will-it-take-for-me-to-learn-Java-I-know-Python-PHP-SQL-and-some-C-C
How long will it take for me to learn Java? (I know Python, PHP, SQL and some C/C++) - Beginner coder - Quora
Answer (1 of 3): Learning Java will be much easier if you already know Python, PHP, SQL, and some C/C++ Langauge. Java is very similar to Python in terms of syntax. However, you should be aware of some significant differences between the two languages. It is important to understand these differen...
🌐
Noble Desktop
nobledesktop.com › how long does it take to learn java?
Java: How Long Does it Take to Learn?
If you are a complete beginner, ... to learn Java is about nine months. For someone who already knows how to code, learning Java could take as little as a month....
Top answer
1 of 16
56

10 weeks? Apparently you can do it in 24 hours!

http://www.amazon.com/Sams-Teach-Yourself-Programming-Hours/dp/0672328445

EDIT:

Okay, so only 1 person found my answer amusing, but not amusing enough to upvote. The real question is how good do you need to be in 10 weeks?

If you get yourself a good book (the one linked above has some good reviews on Amazon), then in 10 weeks you might be proficient enough to do something useful in Java, but it takes years to become expert. Any time spent between 10 weeks and several years will move you from beginner towards expert.

Oh and read Teach Yourself Programming in Ten Years.

2 of 16
30

OK, based on some of the previous answers, I am expecting to get downvoted for this, but, I think you are delusional to think you can learn, on your own, how to program in Java in 10 weeks with no programming background. No person, with NO programming experience, other than some sort of prodigy, is going to learn to program in Java or almost any language in 10 weeks.

For clarity, copying and running hello world from a book does not make you a programmer. Hell, it will most likely take days just to get that working in some IDE.

Now, can you study and potentially pass some test? Maybe, but that depends on the depth and format of the test.

If I asked if I could become a doctor in 10 weeks, I would get laughed at for asking, so I am somewhat surprised at the answers that indicate that it is somewhat possible. I can stick a bandaid on my daughter now, but it hardly makes me a medical professional, it just means I managed their version of hello world.

🌐
JanbaskTraining
janbasktraining.com › home › how long does it takes to learn java?
How Long Does it take to learn Java | JanBask Training
October 28, 2024 - Then you may start with fundamental learning. You may take this knowledge anywhere from one month to at least 6 months (it takes a whole semester in a university undergrad for this course).
🌐
UiPath
credosystemz.com › blog › how long does it take to learn java?
How Long Does It Take to Learn Java? - Credo Systemz
July 7, 2025 - If you are new to programming or from a non-IT background? Learn Java programming with a longer journey (6 months). Have Experience in coding or from a CS/IT background? Already know C++, Python, or another OOP language?
🌐
CodeGym
codegym.cc › java blog › learning java › to infinity and beyond: how long does it take to learn ja...
To infinity and beyond: how long does it take to learn Java?
December 22, 2023 - I think this can take somewhere between nine and twelve months. I know this sounds like a lot of work, but don’t feel discouraged! This journey can be real fun if you discover what aspect of coding is bringing you joy and allow yourself to play.”
🌐
Medium
medium.com › quick-code › how-long-does-it-take-to-learn-java-a-lifelong-challenge-p-s-dont-fret-and-keep-on-reading-f3c11aa6cb2a
How Long Does It Take to Learn Java? A Lifelong Challenge! P.S. Don’t Fret and Keep on Reading | by John Selawsky | Quick Code | Medium
June 20, 2023 - Unit testing is the next important level for any Java programmer who’s going to write unit tests for their code. Once you get the hang of writing tests, you’ll be able to apply them to your projects. Hence, avoid mistakes. Lambda expressions. Today, even Java Juniors should be able to perform manipulations with lambdas, so you should add this topic to your learning plan. Serialization in JSON, RMI, HttpUrlConnection, socket. This is the last step that is more suitable for intermediate-to-advanced Java programmers, which requires deeper knowledge and experience.
🌐
HackerNoon
hackernoon.com › learning-to-program-in-java-heres-how-long-it-will-take
Learning to Program in Java? Here's How Long it Will Take | HackerNoon
November 26, 2021 - Are you about to start coding and gravitate towards an easy, reliable programming language that can be learned in a short time and used for creating a plethora of applications and programs? If yes, you just can’t go wrong with Java. But how long does it take to learn Java to become proficient ...
🌐
Reddit
reddit.com › r/askprogramming › how long will i need to learn java, if i already know c/c++? or how difficult is it?
How long will I need to learn Java, if I already know C/C++? Or how difficult is it? : r/AskProgramming
February 27, 2025 - You already made the right choice by learning c++ first. Assuming you are reasonably good at mapping concepts in your mind (lateral thinking) you should be able to reach a decent fluency in Java in a month or two. It's pretty easy if you already know c++. Java is c++ for people who don't like ...
🌐
Medium
medium.com › javarevisited › going-from-hello-world-to-multithreading-how-much-time-does-it-take-to-learn-java-2090eec3d510
Going From “Hello World” to Multithreading: How Much Time Does It Take to Learn Java? | by John Selawsky | Javarevisited | Medium
May 9, 2023 - Since these questions are extremely common among programming beginners, I decided to take a closer look at the road to Java mastery. Long story short, it takes anywhere from 6 months to decades to from relative to absolute proficiency in Java.
🌐
Quora
quora.com › How-long-does-it-take-to-learn-java-from-basics-if-we-know-c
How long does it take to learn java from basics if we know c? - Quora
October 31, 2015 - Answer (1 of 10): If this is just a matter of syntax, you can learn it as you write javascript code or read a reference. The real problem is mastering what for javascript is intended and the particularities of the language. So I would say in addition to distinguish what is, from syntax point of v...