August 2003
Beginner
600 pages
12h 55m
English
Ordinarily, code within a method executes from beginning to end—literally. However, when a return statement is reached, execution immediately returns to the statement that made the method call; you can force execution to leave the method at any time by using a return statement. If Visual C# .NET encounters a return statement, the method terminates immediately, and code returns to the statement that called the method.
It's possible to call methods in such a way that a continuous loop occurs. Consider the following procedures:
public static void DoSomething()
{
DoSomethingElse();
}
public static void DoSomethingElse()
{
DoSomething();
}
Calling either of these methods produces an infinite loop of methods ...
Read now
Unlock full access