Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.
Trending News
What does "return" do in C#?
public static BankAccount openBankAccount(string owner, double balance, double allowed)
{
BankAccount account;
account = new BankAccount();
account.owner = owner;
account.balance = balance;
account.allowed= allowed;
return account;
}
Why does it return it? What is the meaning of returning? We don't see anything of it when the program is running. Thank you very much.
2 Answers
- 7 years agoFavorite Answer
The statement "return account" returns the the 'account' object to the method from where the call was made. You can store this 'account' object in another object of 'BankAccount' type and copy the reference of this 'account' in that object for using it in the caller method.
- WiseOneLv 77 years ago
It returns the instance of BankAccount (account) back to the caller of the method.