003 Java and C ++ similarities and differences

1, the same point:

    Is an object-oriented language that supports encapsulation, inheritance, and polymorphism. 

2, different points:

  (1) Java does not provide a pointer to directly access memory, program memory safer

  (2) Java class is single inheritance, C ++ supports multiple inheritance; although not Java class multiple inheritance, but the interface can be multiple inheritance

  (3) Java has automatic memory management mechanism, programmers do not need to manually release the memory useless, but in C ++ programmer is responsible for the existence of allocation and recovery work.

Guess you like

Origin www.cnblogs.com/xwwbb/p/11068279.html