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 trialyvesramos
12,816 PointsConfuse with parameters
Hi, I am a little confuse with the parameters in this code;
void SendMessage(string message, string recipient) { }
string ReceiveMessage() { }
Which one is the first and second parameters? and Which one takes a parameter?
Thanks in advanced
1 Answer
andren
28,558 PointsWhen you define a method you define its parameters in the parenthesis following the method name.
The SendMessage
method has two parameters. The first is of type string
and is named message
, the second is of type string
and is named recipient
.
The ReceiveMessage
method has no parameters.
yvesramos
12,816 Pointsyvesramos
12,816 PointsThanks andren for your response. So "string message" it will be the firs parameter? and string Receive Message() {} is calling the parameter? or what this code do?
Thanks once again.