G****A 发帖数: 4160 | 1 即使不声明为static,无论建立多少个instances,class function始终只keep一个copy。
既然这样,请问为什么只有被声明为static function 才能 be called without an
instance of the class. |
h*******s 发帖数: 8454 | 2 不是static的函数调用的时候系统自己给牵头加上一个this指针作为第一个参数
如果没有instance,哪儿来得this指针啦
不是static的函数可以修改instance自己的私有变量啊,虽然只有一个,但是从哪里调
用还是有区别的
copy。
【在 G****A 的大作中提到】 : 即使不声明为static,无论建立多少个instances,class function始终只keep一个copy。 : 既然这样,请问为什么只有被声明为static function 才能 be called without an : instance of the class.
|
b********n 发帖数: 609 | 3 你这简直连入门都谈不上啊。
copy。
【在 G****A 的大作中提到】 : 即使不声明为static,无论建立多少个instances,class function始终只keep一个copy。 : 既然这样,请问为什么只有被声明为static function 才能 be called without an : instance of the class.
|
G****A 发帖数: 4160 | 4 是啊,coding水平比本科时候还差。只有恶补了
【在 b********n 的大作中提到】 : 你这简直连入门都谈不上啊。 : : copy。
|
y****e 发帖数: 23939 | 5 能这样去思考问题,已经很不错了。继续努力!
【在 G****A 的大作中提到】 : 是啊,coding水平比本科时候还差。只有恶补了
|