Define and call method - CSharp Custom Type

CSharp examples for Custom Type:Method

Description

Define and call method

Demo Code

using System;/*w  w w  . j a  v  a  2 s  . c  o m*/
class Program
{
   static void Main(string[] args)
   {
      myMethod();
      printNumber(6);
      int num = 64;
      printNumber(num);
      Console.ReadKey();
   }
   static void myMethod()
   {
      Console.WriteLine("This is my shiny new method!!");
   }
   static void printNumber(int num)
   {
      Console.WriteLine("Number: {0}", num);
   }
}

Result


Related Tutorials