Home > database >  A novice for help! How to understand the method return values?
A novice for help! How to understand the method return values?

Time:10-12

CodePudding user response:

Public integer
Tell you need a type integer return values

CodePudding user response:

Call this method returns a value of type, the code inside there must be return

CodePudding user response:

reference 1st floor Dear200892 response:
public integer
Tell you need a type integer return values

What is action? How to understand?

CodePudding user response:

refer to the second floor sxq129601 response:
calls this method returns a value of type, the code must be inside the return

What is the role? How to understand?

CodePudding user response:

this is a c # I


Usually, such sum shall return values, such as
Private int the add (int a, int b)
{
return a+b;//it is returned a + b and, when you use the function, as long as you a, b values have
}
Use it like this:
Int s=add (100200);//took 100 + 200 or 300 of the value assigned to s

At the same time also limits the function must return a value of type int

CodePudding user response:

Methods: processing plant
Parameters: raw material
The return value:
processing results
You the screenshots, is not implemented method, does not make sense,
The following simple method, which is used to illustrate better point,
 
//methods: access to the input parameters of 2 times the value of the
Public int Get2X (int x) {
Int result=2 * x;
return result;
}

CodePudding user response:

I probably understand, thank you!

CodePudding user response:

reference 5 floor Dear200892 reply:
this is a c # I


Usually, such sum shall return values, such as
Private int the add (int a, int b)
{
return a+b;//it is returned a + b and, when you use the function, as long as you a, b values have
}
Use it like this:
Int s=add (100200);//took 100 + 200 or 300 of the value assigned to s

At the same time also limits the function must return a value of type int

General meaning: I see, thank you
  • Related