While creating variable for the delegate instead of creating class and creating object for the class then anonymous method can be used.