|
|
楼主 |
发表于 2010-10-15 18:12:55
|
显示全部楼层
Multiple functions can have the same name, as long as they have different parameters.Creating different functions with the same name is called function overloading, and it’s what allows Processing to have more than one version of functions like fill(),image(), and text(), each with different parameters.
A program can also have two functions with the same number of parameters, but only if the data type for one of the parameters is different.
需要注意的是,function可以同樣命名處理不同的功能,但裡面的參數必須不一樣。
重複命名的特性就像processing 內建好的fill(),image(),text().一樣。這種功能稱做
Function overloading |
|