Solution: delegates

Let's discuss the solution to the coding exercise on delegates.

We'll cover the following

Problem

This activity uses delegates for a naming program. Create a console application called Naming Concatenation that meets the requirements listed below.

  1. Create a method that receives the first and second name as parameters and returns the full name by concatenating them with a space. For example, if a method receives David and Smith as parameters, it should return David Smith.

  2. Define a delegate variable for the defined method in the above requirement.

  3. Call the defined method by a delegate variable.

Get hands-on with 1400+ tech skills courses.