Metotların aşırı yüklenmesi(OverLoad) ile ilgili bir örnek:

////////////////////Cihan TURGUT////////////////

using System;

class metotyukleme
{
static void metot1(int x,int y)
{
Console.WriteLine(”1.metot çağrıldı.”);
}

static void metot1(float x,float y)
{
Console.WriteLine(”2.metot çağrıldı.”);
}

static void metot1(string x,string y)
{
Console.WriteLine(”3.Metot çağrıldı”);
}

static void Main()
{
metot1(”deneme”,”deneme”);
metot1(5,6);
metot1(10f,56f);

Console.ReadLine();
}
}

Leave a Reply

You must be logged in to post a comment.