What is the main difference in object creation between Java and C++?

后端 未结 7 625
感动是毒
感动是毒 2021-01-31 19:12

I\'m preparing for an exam in Java and one of the questions which was on a previous exam was:\"What is the main difference in object creation between Java and C++?\"

I t

7条回答
  •  悲哀的现实
    2021-01-31 19:46

    Besides heap/stack issues I'd say: C++ constructors have initialization lists while Java uses assignment. See http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.6 for details.

提交回复
热议问题