C++ vs Java constructors

前端 未结 14 2454
一个人的身影
一个人的身影 2021-02-09 20:31

According to John C. Mitchell - Concepts in programming languages,

[...] Java guarantees that a constructor is called whenever an object is created.

14条回答
  •  误落风尘
    2021-02-09 21:29

    In C++, when an object is instantiated, a constructor of that class must be called.

提交回复
热议问题