构造函数

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

Measure Word

Meanings

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

Examples

Zhège lèi de gòuzàohánshù jiēshòu liǎng gè cānshù.
This class's constructor takes two parameters.
Chuàngjiàn duìxiàng shí huì zìdòng diàoyòng gòuzàohá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 析构函数 (xīgòuhánshù).

Stroke Order

gòu
zào
hán
shù