Define function : Function Definition « Language Basics « C# / C Sharp






Define function

Define function
/*
Learning C# 
by Jesse Liberty

Publisher: O'Reilly 
ISBN: 0596003765
*/
 using System;
public class Functions
 {
     static void Main()
     {
         Console.WriteLine("In Main! Calling SomeMethod()...");
         SomeMethod();
         Console.WriteLine("Back in Main().");

     }
     static void SomeMethod()
     {
         Console.WriteLine("Greetings from SomeMethod!");
     }
 }

           
       








Related examples in the same category

1.Recursive sum methodRecursive sum method
2.Use a recursive method, travel, to journey from start to finishUse a recursive method, travel, to journey from start to finish
3.Recursive Factorial method.
4.Recursive function in actionRecursive function in action
5.Catch StackOverflowException for recursive function