The following example demonstrates the ObsoleteAttribute(String, Boolean) constructor. It contains a function which calls a method that has been designated obsolete and attempts to catch an exception using a try/catch block. The String parameter is displayed as a workaround message, and the Boolean parameter indicates that no error has occured.