using System;
namespace Console_Function_return_keyword
{
class Program
{
public void MyMethod()
{
Console.WriteLine("Hi");
return;
}
public string NextMethod()
{
return "Hello";
}
public string AnotherMethod()
{
return "Hello";
Console.WriteLine("I am unreachable code");
}
static void Main(string[] args)
{
Program p = new Program();
p.MyMethod();
Console.WriteLine(p.NextMethod());
}
}
}
OUTPUT
Hi
Hello
No comments:
Post a Comment