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