Is 'void' a valid return value for a function?
问题 private void SaveMoney(string id...) { ... } public void DoSthWithMoney(string action,string id...) { if(action=="save") return SaveMoney(string id); ... } Why won't C# let me return the void of the private function back through the public function? It even is the same data type "void"... Or isn't void a data type? Is the following code really the shortest workaround? if(action=="save") { SaveMoney(string id); return; } 回答1: void is not an actual return (data)type! void says there is no