Lecture overview -- Keyboard shortcut: 'u'  Previous page: Serialization and Alternatives -- Keyboard shortcut: 'p'  Next page: Patterns and Techniques [Section] -- Keyboard shortcut: 'n'  Lecture notes - all slides together  Annotated slide -- Keyboard shortcut: 't'  Textbook -- Keyboard shortcut: 'v'  Alphabetic index  Help page about these notes  Course home    Input and Output Classes - slide 36 : 40

Attributes

Attributes offer a mechanism that allows the programmer to extend the programming language in simple ways.

Attributes can be accessed by the compiler and - at run-time - by the interpreter

prog.cs
An obsolete class C, and a class D with an obsolete method M.
compiling
Compiling class C, D, and E.
obsolete.cs
A reproduction of class ObsoleteAttribute.
usage-obsolete.cs
Sample usage of the reproduced class - causes a compilation error.