We are not going to formally use textbooks for this course. Paying attention to what is taught in class shoud be quite sufficient, for you to learn the basics of C++ and Java.
That said, here are some good reference books for you [see below] - you do NOT need to purchase any of these! And, there are lots of good websites as well...
Texts
C++
Java
General
GeeksforGeeks: a MEGA portal for algorithms, data structures: https://www.geeksforgeeks.org/
Websites
Both C++ and Java are mature, widely-used languages, which means there are numerous pages that are devoted to teaching them, discussing issues related to them, etc. Below is a small sampler.
LearnCpp.com is an excellent site, with extremely well-written mini 'tutorials' on a huge number of C++ topics.
C++ FAQ - very thorough "go to" reference.