Lecture overview -- Keyboard shortcut: 'u'  Previous page: Control Structures for Selection -- Keyboard shortcut: 'p'  Next page: Control Structures for Iteration -- Keyboard shortcut: 'n'  Lecture notes - all slides and notes together  slide -- Keyboard shortcut: 't'  Textbook -- Keyboard shortcut: 'v'  Help page about these notes  Alphabetic index  Course home  Page 31 : 43
Object-oriented Programming in C#
Introduction to C#
Control structures for Selection

  • If-then-else

    • Similar in the two languages

  • Case

    • C#: Efficient selection of a single case - via underlying jumping

    • VB: Sequential test of cases - the first matching case is executed

    • VB: Select Case approaches the expressive power of an if-then-elseif-else chain

    • Case "fall through" is disallowed in both languages