Users Online

· Guests Online: 136

· Members Online: 0

· Total Members: 188
· Newest Member: meenachowdary055

Forum Threads

Newest Threads
No Threads created
Hottest Threads
No Threads created

Latest Articles

Sample Delegate Program using C#

Sample Delegate Program using C#:

 

 

 

/*
 *  C# Program to Display Results using Delegates
 */
using System;
public class example
{
    public delegate int DelegateHandler(int a, int b);
    public static void Main(string[] args)
    {
        Results Results = new Results();
        DelegateHandler sum = new DelegateHandler(Results.sum);
        int result = sum(50, 20);
        Console.WriteLine("Result is: " + result);
        Console.ReadLine();
    }
}
 
public class Results
{
    public int sum(int a, int b)
    {
        return a + b;
    }
}

 

Comments

No Comments have been Posted.

Post Comment

Please Login to Post a Comment.

Ratings

Rating is available to Members only.

Please login or register to vote.

No Ratings have been Posted.
Render time: 0.71 seconds
10,812,176 unique visits