Saturday, November 19, 2016

Brain Teaser - Lamda Expressions

In this post, I will be showing how we can we replace Delegate with lambda expression from the code in the previous post .
  • Keep the car class as it was in previous post.

  • Inside Audi and Benz classes, use delegate with anonymous methods using Lamda expressions as below.   
   


  • Now make use of the above classes and see the output

            

No comments:

Post a Comment