What is calling method and called method?

2020-06-06 01:34发布

问题:

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.