I have some experience with C++ but now we are learning only java in college. They are really similar and, supposedly, Java is more advanced. Is there some advantage that C++ has over Java that makes it the prefered language, or are the two pretty much interchangable? thanks
I think comparing Java and C++ is not really a good idea, the languages are targeted differently. Java is extremely useful if you need portable applications, for example for web-based applications and similar things. Java is quite slow when comparing it to optimized native code, and the memory footprint is just ... well BIG. Java has garbage collection, prohibits the use of pointers (that is, you can''t modify the machines memory directly), etc., which makes it high-level language (which doesn''t mean its better). C++, and especially C are, in contrast, low level.
One thing which makes me dislike Java is the Libraries/Classes coming with it. C++ does only have some very basic operations in its standard library, and you don''t really need to know them (such as the STL). Java, now, comes up with a lot of classes whose use seems to be inevitable to produce accetable code quality in appropriate time.
Using C++, however, you will often find yourself reading something about some API needed for this and that, such as the Windows API. Java provides classes for Window-Management, so to speak, these functions are ''included'' in the language.
In the end, performance-relevant applications have to use native code. Applications that need to be extremely portable will probably use Java. I think if you are a hobby programmer, it is a matter of taste.
I personally do not like languages which do too much in the background, therefore I dislike Java, and do not make use of C++ features whose exact behaviour I don''t know. Also, not using pointers is like a world without sun for me ...