构造函数

構造函數
gòuzào hánshù
noun

Measure Word

Meanings

  1. 1 constructor (OOP)
  2. 2 constructor function

Examples

HSK 7-9
Zhège lèi de gòuzào hánshù jiēshòu liǎng gè cānshù.
This class's constructor takes two parameters.
HSK 7-9
Chuàngjiàn duìxiàng shí huì zìdòng diàoyòng gòuzào hánshù.
The constructor is called automatically when creating an object.

Tips

memory
构造 (to construct) + 函数 (function) - literally a 'construction function', i.e. the function that constructs/builds an object. Destructor is 析构函数.

Stroke Order

gòu
zào
hán
shù