Thank you very much. It's safe to say you can learn to code C++ and Java from scratch (knowing nothing) on Mac without needing Windows? (I've heard a lot of people say you can't)
You absolutely
don't need Windows to learn C++/Java. The languages themselves are completely system independent.
I think that the myth might stem from the days of 'Classic' Mac OS which certainly wasn't the best system to learn programming on. That changed completely with OS X which, under the hood, is Unix, and Unix would be the system of choice for many Computer Science departments.
Where it gets more complicated is when you've
learnt enough C++ or Java and you want to start writing programs with 'proper' windows-icons-and-mice user interfaces. Then you're faced with the task of learning the user interface 'API' for your system of choice, which can be as much trouble as learning to program in the first place (and keeps on flippin' well changing every year, too, unlike C++ and Java themselves!). In this case, Windows and Mac are completely different (apart from some underlying common concepts).
All is not lost, because there are cross-platform user interface libraries that hide the differences from the programmer. Java, in particular, sells itself on cross platform support and comes with graphics and user interface libraries that work on any system. These are pretty much "part of" Java and will likely be covered in any "learn Java" book or course. There are also cross-platform GUIs that can be used with C/C++ but are not so commonplace, or as tightly associated with the language, as Java.
Programs using Cross-platform GUIs are never quite as slick as ones written specifically for either Mac or Windows - but they get the job done.
Of course, there are huge swathes of the art of programming work that
don't involve Windows desktop apps (e.g. scientific/mathematical computing, systems programming/server applications) and for which the Mac will be just as good as Windows (if not better, because of it's Unix roots). Or, you might
want to learn Mac desktop - or iPhone/iPad - programming, although in that case you'd be better off with Objective C rather than C++ (the two are very different).
However that's the theory - let's temper that with a bit of reality: if you're taking a course at a school/college then you'll probably find it smoother going to use the same system as everybody else (unless they enthusiastically support both Macs and PCs).
Also, few cross-platform systems are sufficiently reliable that you can
assume that anything you write on Mac will run perfectly on Windows- you need to test. The solution to that is to have Windows running in a virtual machine - which is a great solution for 'serious' development but a complication you could do without while learning.