return
The
return
statement causes a method to return. It can also be used to return a value. It is
examined in Chapter 6.
The goto
The
goto
is C#’s unconditional jump statement. When encountered, program flow jumps to
the location specified by the
goto
. The statement fell out of favor with programmers many
years ago because it encouraged the creation of “spaghetti code.” However, the
goto
is still
occasionally—and sometimes effectively—used. This book will not make a judgment
regarding its validity as a form of program control. It should be stated, however, that there
are no programming situations that require the use of the
Do'stlaringiz bilan baham: |