-2

I ran into a problem while writing the TwoFer program enter image description here

This is the program's code

public static class TwoFer
{
    public static string Speak()
    {
        return "One for you, one for me.";
    }
    public static  Speak(string h)
    {

        if (h == "Bob")
        {
            return "One for Bob, one for me.";
        }
        else
        {
            return "One for Alice, one for me.";
        }
    }
}
Hediye_seza
  • 61
  • 1
  • 2
  • 17

1 Answers1

2

Your Speak(string) method is missing a return type:

public static String Speak(string h)
// Here ------^
Mureinik
  • 297,002
  • 52
  • 306
  • 350