Lecture overview -- Keyboard shortcut: 'u'  Previous page: A Composite Example: A GUI  -- Keyboard shortcut: 'p'  Next page: Cloning in C# -- 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 30 : 37
Object-oriented Programming in C#
Abstract classes, Interfaces, and Patterns

Cloning creates a copy of an existing object


  • Object cloning

    • Shallow cloning:

      • Instance variables of value type: Copied bit-by-bit

      • Instance variables of reference types:

        • The reference is copied

        • The object pointed at by the reference is not copied

    • Deep cloning:

      • Like shallow cloning

      • But objects referred by references are copied recursively