Home > front end >  TwoFer program Bug
TwoFer program Bug

Time:07-10

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.";
        }
    }
}

CodePudding user response:

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

public static String Speak(string h)
// Here ------^
  • Related