The void type translated into Chinese means the empty type.
Generally, when declaring variables, void type declaration is not used, and functions are commonly declared void type.
A function declared with the void type means that it does not need to return a value.
However, sometimes it is necessary to forcibly terminate the function inside the function to continue running the following statement. In this case, use the return statement. The format is:
return;
If you use int, float, double, etc. to declare the function body, you need to return the value. The format at this time is:
return value;
for example:
return 0;
return 0.1;
use return in void method
Guess you like
Origin http://43.154.161.224:23101/article/api/json?id=325904276&siteId=291194637
Recommended
Ranking