|
2m
楼主 |
发表于 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可以同樣命名處理不同的功能,但裡面的參數必須不一樣。
|
|