Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

C#

The type of the first parameter in the following method is . void SendMessage(string message, string recipient) { }

Can someone help me i'm stuck here

2 Answers

Steven Parker
Steven Parker
229,708 Points

The basic format of a method declaration is:

  • <method return type> <method name>(<parameter type> <parameter name>, ...(repeat)... ) { }

So, for void SendMessage(string message, string recipient) { }:

  • the method return type is void
  • the method name is SendMessage
  • the first parameter type is string
  • the first parameter name is message
  • the second parameter type is string
  • the second parameter name is recipient

Thanks Steven. That helped :)

Thanks it works Steven