[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More
Experts Exchange Solution brought to you by
"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.
The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.
Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.
private void DiagnosticLog(string message)
private static void Main(string args)
Console.WriteLine("1 + 2 = " + (1 + 2).ToString());
Open in new window
The first one is that it can be applied to only part of a method.
private static decimal _account = 100;
static void Main(string args)
decimal toDebit = 10;
decimal balance = Withdraw(toDebit);
private static decimal Withdraw(decimal amount)
bool accountHasFunds = CheckThatAccountHasFunds();
private static bool CheckThatAccountHasFunds()
return (_account > 0);
private static void DebitAccount(decimal amount)
_account -= amount;
The question as I understand it is about how to supply a default/standard set of data under certain conditions, at other times to use 'real' data.
Your example above doesn't change the source,
From novice to tech pro — start learning today.
Premium members can enroll in this course at no extra cost.