I'm a huge fan of Prata's C++ Primer Plus
. There's a 6th edition, but I'm not familiar with that one. I learned far more from this book than from two semesters of college-level C++ for IT majors. For a gentler intro, if you're brand new to programming, C++ Without Fear
is an excellent starting point, then move on to the Prata.
For Java, I recommend Head Start Java.
It's very, very different from any other learn-to-program book out there. Especially recommended for the attention-challenged!
I heartily do not
recommend anything by the Deitels--as a short version, they overcomplicate the simple things, oversimplify the complicated things, and charge far too much for their books. Avoid at all costs.