0% found this document useful (0 votes)
10 views1 page

Overloading

The document contains a C# program that demonstrates method overloading by defining multiple 'Yaz' methods that accept different parameter types. It includes methods for integers, characters, strings, doubles, booleans, and overloaded methods for pairs of integers and doubles. The 'Main' method calls these overloaded methods with various arguments to showcase their functionality.

Uploaded by

e.m.abd205
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views1 page

Overloading

The document contains a C# program that demonstrates method overloading by defining multiple 'Yaz' methods that accept different parameter types. It includes methods for integers, characters, strings, doubles, booleans, and overloaded methods for pairs of integers and doubles. The 'Main' method calls these overloaded methods with various arguments to showcase their functionality.

Uploaded by

e.m.abd205
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

C:\Users\Emadr\Desktop\Overloading.

cs 1
using System;

class Program
{
public static void Yaz(int sayi)
{
[Link](sayi);
}
public static void Yaz(char karakter)
{
[Link](karakter);
}

public static void Yaz(string metin)


{
[Link](metin);
}

public static void Yaz(double sayi)


{
[Link](sayi);
}

public static void Yaz(bool durum)


{
[Link](durum);
}

public static void Yaz(int sayi1, int sayi2)


{
[Link]($"{sayi1} - {sayi2}");
}

public static void Yaz(double sayi1, double sayi2)


{
[Link]($"{sayi1} - {sayi2}");
}

static void Main()


{

Yaz(12); // int
Yaz('a'); // char
Yaz("KOU"); // string
Yaz(10.45); // double
Yaz(true); // boolean
Yaz(10, 15); // 2 int
Yaz(10.05, 55.895); // 2 double
}

You might also like