2个回答
展开全部
http://msdn.microsoft.com/zh-cn/7s3cbse0(VS.80).aspx
class MyClass
{
static string myMethod(string precip, string country, string location)
{
return string.Format("The {0} in {1} stays mainly in the {2}.",
precip, country, location );
}
static string myMethod(string precip, string country )
{
return myMethod(precip, country, "plain");
}
static string myMethod()
{
return myMethod("rain", "Spain", "plain");
}
static void Main(string[] args)
{
System.Console.WriteLine(myMethod());
System.Console.WriteLine(myMethod("snow", "Walla Walla"));
}
}
class MyClass
{
static string myMethod(string precip, string country, string location)
{
return string.Format("The {0} in {1} stays mainly in the {2}.",
precip, country, location );
}
static string myMethod(string precip, string country )
{
return myMethod(precip, country, "plain");
}
static string myMethod()
{
return myMethod("rain", "Spain", "plain");
}
static void Main(string[] args)
{
System.Console.WriteLine(myMethod());
System.Console.WriteLine(myMethod("snow", "Walla Walla"));
}
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询