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 Strings Combining Strings

Redon Kalemaj
Redon Kalemaj
1,227 Points

I don't know if you can see my problem, but it gives me error codes on the line that I am trying to return a string.

Program.cs
using System;

class Program
{
static string Eat(string first, string second);

      string myString = Console.WriteLine("I think " + first + " and " + second + " are tasty!");
      return myString;


    static void Main(string[] args)
    {
        Console.WriteLine(Eat("apples", "blueberries"));
        Console.WriteLine(Eat("carrots", "daikon"));
    }

}
Shawn McCall
Shawn McCall
7,863 Points

Hi Redeon,

It looks like your method doesn't have opening or closing curly braces. In fact, you put a semi-colon instead.

You would need to do something like this:

static string Eat(string first, string second) { // The rest of your code goes here. }

1 Answer