What is calling method and called method?

自作多情 提交于 2020-05-10 06:21:19

问题


Are calling method and called method both same?

What I would like to know is "calling method" means the method which calls another method that is main method in most cases, or the main method itself?


回答1:


The calling method is the method that contains the actual call; the called method is the method being called. They are different. For example:

// Calling method
void f()
{
    g();
}

// Called method
void g()
{
}



回答2:


The calling method is the method that contains the actual call.

The called method is the method being called. They are different.

They are also called the Caller and the Callee methods.

For example

int caller(){
int x=callee();
}

int callee(){
return 5;
}



回答3:


called method means initialization of a method. calling method means where we are using that initialized method.



来源:https://stackoverflow.com/questions/10469910/what-is-calling-method-and-called-method

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!