TwoFer program Bug

75 Views Asked by At

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

There are 1 best solutions below

0
Mureinik On BEST ANSWER

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

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