the difference between java and c ++ (simplified)

Whether in the learning process, or an interview, when asked the difference tends to be java and C ++. Java is not just a variant of the C ++ language, they are fundamentally different in some essence of the problem:
  (1) higher than C ++ Java program reliability. Java language by changing the language features greatly enhanced the reliability of the program. For example: JAVA exception mechanism is used to capture exceptions, enhance system fault tolerance
  (2) Java language does not require the program to memory allocation and recovery. C ++, Java discarded rarely used, poorly understood, confusing those features, such as operator overloading, multiple inheritance, automatic type coercion. In particular, the Java language does not use pointers, and provides automatic garbage collection, Examda Tip: In the Java language, memory allocation and deallocation are automated, the problem of memory fragmentation programmers need not consider.
  (3) no pointer concept Java language, the introduction of a real array. Is different in C ++ using the "artificial array" pointer implementation, Examda, Java introduces a real array, while likely to cause pointer trouble removed from the language, which will help prevent common in c ++ program as an array of operating cross-border, etc. pointer operations performed insecurity caused by illegal system to read and write data.
  (4) Java Multiple inheritance substituted C ++ program with an interface (Interface) technology. Interfaces with multiple inheritance has the same function, but eliminates the complexity of multiple inheritance in the implementation and maintenance.

Guess you like

Origin blog.csdn.net/hnu_zzt/article/details/88867051