Posts

Showing posts from May, 2021

Differences between Java and C++

  Java and C++         Java is true Object-Oriented language while C++ is basically C with object-oriented extension. That is what exactly the increment operator ++ indicates. C++ has maintained backward compatibility with C. It is therefore possible to write an old style C program and run it successfully under C++. Java appears to be similar to C++ when we consider only the “extensions” part of C++. However, some object-oriented features of C++ make the C++ code extremely difficult to follow and maintain.           Listed below are major C++ features that were intentionally omitted from java or significantly modified. 1. Java Does not support operator overloading. 2. Java does not have template classes as in C++. 3. Java does not support multiple inheritance of classes. This is         accomplished using a new feature called “interface”. 4. Java does not support global variables. Every variables and         methods   is declared within a class and forms part of the class.