Java and C++ are both C-based languages, but that is about where the similarities end. You will find that many languages are C-based which can help in learning other languages, but can also cause a bit of confusion when moving between languages.
The syntax between languages changes, but the logic doesn't. Being a good programmer is all about understanding logic and how to approach what you want done. Going back and forth between languages is frustrating, and that's when Google is your friend. At my previous job, I was using four programming languages at once at one point and it was hard to keep up with what syntax I had to use where . But as long as you understand things, you should know what to put in Google that will yield you the syntax you need.