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 OverflowI 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.
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++.
Realistically how long does it take to learn Java?
Professional for 10 years, still learning every day!
More on reddit.comHow Long Does it Take to Learn Java for a Complete Newbie? - Stack Overflow
How long will I need to learn Java, if I already know C/C++? Or how difficult is it?
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
I know learning doesn't happen overnight and it takes time and practice. But on average how long does it take to "click". That moment when everything makes sense.
How proficient do you need to be to make an android app that actually functions?
Professional for 10 years, still learning every day!
I think it's more of a gradual click. Lots of stuff to learn, not just syntax and technical bits, but design patterns and best practices, particular libraries, and so on. I'm about a year in myself, and I'm just starting to feel like I could get a job soon. But, haven't been reading Java every day, as I'm studying at university and got other classes besides programming. My guess is, if you study Java every day - you could probably get employed in 6 months.
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.
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.