I ran into a problem while writing the TwoFer program
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 ------^