1. 1 Java has no unsigned integer. (unsigned right shift is forced to be represented by three right angle brackets in Java).
1.2 Java has built-in type strings, but C++ doesn't. The std::string of C++ is variable, similar to the StringBuffer of Java.
The integer of 1.3 C++ varies with the number of bits in the machine, but Java does not. (The int of C++ is 16 bit on a 16 bit machine, and it is 32 bit above 32 bit level. Long is a 64-bit machine with 32 bits and below and 64 bits. )
1.4 Java strings are stored in memory in Unicode, and the coding of C++ is the same as the source code.
Pointer does not exist in 1.5 Java. The reference of Java is a pointer with weakened function, and it can only do the operation of "calling the method of the pointed object".
1.6 Java's Stream object (except PrintStream) has a single function, and can only read and write by bytes, and needs the assistance of Reader or Writer. Any C++ stream can be read and written in bytes, strings and shapes.
1.7 Java is one of the few languages that cannot compare strings with double equal signs.
Generic parameters of 1.8 Java are not allowed to be primitive types. (pit)
1.9 Java forces local variable initialization.
2. Class mechanism 2. 1 Java is completely object-oriented, and all methods must be written in classes.
2.2 Java forced exception specification.
2.3 Java single root inheritance, all Objects inherit from object. And provides an interface mechanism.
2.4 Java overrides default to a virtual function.
2.5 Java has no default parameters.
2.6 There are no operator overloading and conversion functions in Java.
2.7 Java value passing without reference. (Packing is usually used in standard libraries. )
2.8 Java has no structure or union.
2.9 Java can delegate construction, but C++ 14 adds this feature.
2. 10 Java objects (including arrays) are stored on the heap, and new is used. C++ can be stored on the stack or on the heap.
2. 1 1 Java can define abstract classes and final classes, but it must be inherited or not. C++ until C++ 1? To support this feature.
2. 12 Java forces a file to have only one public class/interface, and the file path is forced to be its package name and class name.
3. Other language features 3. 1 Java has no delete operator, so it doesn't need to be deleted because it is managed by gc.
3.2 Java does not have typedef, nor does it have any syntax that is the same as its function.
3.3 Java has no macros. On the other hand, it is also a benefit, and macro is another source of all evil.
3.4 Java uses the dot operator to do what C++ does with the:: operator. The Java:: operator can turn a static function or a dynamic function with an object into a closure (Java8).
3.5 The lambda expression of Java was introduced in Java8, and C++ came from C++ 1 1.
3.6 C++ 1 1 introduced the range loop, and Java came from Java5.
3.7 C++ only looks for the upper part of that line in the current code file when looking for a name. And the search scope of Java is the whole project. (This is why C++ needs include and Java doesn't. )
3.8 Java has a rich standard library (especially GUI). If C++ wants to achieve the same function, it can call the api of the system in addition to the third-party library.
8. 3.9 Java before switch does not support strings. C++ supports short string switching of 1 1 (within 4 bytes, it will be mapped into int to judge).
3. 10 Because Java is semi-compiled and semi-interpreted, its running speed is slightly slower. Jvm startup speed is not generally slow.