Coding Exercise: delegates

Let's test your understanding of delegates.

Problem

This activity uses delegates for a naming program. Create a console application for a naming concatenation app that meets the requirements 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 for the defined method in the above requirement.

  3. Call the defined method by a delegate variable.

Sample input

Delegate method will receive two string parameters, e.g.

"David", "Smith"

Expected output

The finished output of the program should look like the example below:

David Smith

Get hands-on with 1400+ tech skills courses.