When we talk about programming languages two most famous programming languages come to our mind C++ and Java. C++ is an older language as compared to Java, however the syntax of two languages is pretty much same, in fact syntax of java is inspired by the syntax of c++, the following discussion is about some major differences between Java and c++.
First of all C++ has its backward compatibility with c-language but Java has no backward compatibility with older languages. In c++ you can do your job without using object oriented approach i.e without making classes, but in java everything is done within the classes and nothing is done outside the classes. C++ was made for programming operating systems and other system programs but Java is mostly used for network computing. Java doesn’t have support for unsigned arithmetic by default but C++ has got it by default.
In C++ you have to manage your memory usage by your own but in Java a garbage collector manage the memory, so this might be a plus point of Java over C++. In c++ one can work on classes, structures etc. but in Java one can only work in classes. In Java there is no concept of a pointer on the forehand. In functionality c++ has a very limited scope as compared to Java however c++ includes General Utilities, Language Support, Input and output and Standard C Library, and other third party libraries for GUI’s, but in Java the functionality is increased because it has support for XML,XSLT,MIDI, database connectivity, cryptography, security services , print services, and web services.
In c++ operator overloading is available for most of the binary operators, but in java only + and += operators can be overloaded with String data type. Syntax is very similar but taking input in Java takes many lines to write and takes many functions to be called instead of ‘cin’ in c++.
In short c++ is a powerful language made for designing system software’s while Java is an easy to use language designed for general programming other than system software’s programming.