Method in c#.net with example

A method is a member function of a class .It consists of block of statements that returns some value to another method.
Example:-
using System;

public class BaseClass
{
    public void Printmessage()
    {
        Console.WriteLine("Hiiiiiii…..");
    }
}
public class ConsoleApps
{
   public static void Main(string[] agrs)
    {
        BaseClass  objbs = new BaseClass ();
        objbs. Printmessage ();
    }
}



Method in c#.net with example Method in c#.net with example Reviewed by NEERAJ SRIVASTAVA on 9:33:00 AM Rating: 5

No comments:

Powered by Blogger.