Project Type: Console Application
class Program {
static void Main(string[] args) {
Console.WriteLine("Main Started");
Greet();
Console.WriteLine("Main Completed");
Console.ReadKey();
}
private static void Greet() {
Console.WriteLine("Hi, Good Morning!");
}
}
Above programs calls a static method “Greet” from Main method.
Output
Main Started Hi, Good Morning! Main Completed
No comments:
Post a Comment