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# C# Basics (Retired) Console I/O Recap

yvesramos
yvesramos
12,816 Points

Confuse 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
andren
28,558 Points

When 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
yvesramos
12,816 Points

Thanks 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.