Home > Back-end >  Java program is a small problem can be solved
Java program is a small problem can be solved

Time:12-02

This program one less calculation, and went in, I write the calculation value of the output is always a, how do I use this return ah

CodePudding user response:

The use of the return, is mainly used to return to the method of the return value, for later use, the end of the second method can also be used as a keyword, finish execution of the method,
You used to dealing with the maximum method is to return the value of the first parameter, namely a, do you still want to be what the results, you don't write for determining the maximum processing method inside logic, only returned to the a, look at it carefully

CodePudding user response:

1/f, reference source is a ghost reply:
return of usage, method is mainly used to return to the return value, for later use, the end of the second method can also be used as a keyword, end method of execution,
You used to dealing with the maximum method is to return the value of the first parameter, namely a, do you still want to be what the results, you don't write for determining the maximum processing method inside logic, only returned to a, but take a closer look at

This picture is not written calculation before

CodePudding user response:

refer to the second floor ヾ Y reply:
Quote: 1/f, reference source is a ghost reply:
return of usage, method is mainly used to return to the return value, for later use, the end of the second method can also be used as a keyword, end method of execution,
You used to dealing with the maximum method is to return the value of the first parameter, namely a, do you still want to be what the results, you don't write for determining the maximum processing method inside logic, only returned to a, but take a closer look at

This picture is not written calculation before the

You calculation logic is wrong, every time dealing with the result of the wrong, have returned to a
  • Related