Uebungsaufgaben_ITFS2_SS_2025/Exercises/E19_Überladung/Exercise_3.cs
2025-03-11 17:02:35 +01:00

44 lines
1.2 KiB
C#

using System;
using System.IO;
using System.Collections.Generic;
namespace Exercises_C_Sharp.E19_Überladung
{
class Exercise_3
{
//Sorgen Sie dafür, dass die unteren Elemente auf der Konsole ausgegeben werden.
public static void Start()
{
Output(12);
Output("Hallo", 12.5);
Output( 15.15, "Heyho");
Output(123, "Element", 'G');
}
//Code START
static void Output(int d)
{
Console.WriteLine("DER INTEGER: " + d);
}
static void Output(string d, double d2)
{
Console.WriteLine("DER STRING: " + d);
Console.WriteLine("DER DOUBLE: " + d2);
}
static void Output(double d2, string d)
{
Console.WriteLine("DER STRING: " + d);
Console.WriteLine("DER DOUBLE: " + d2);
}
static void Output(int d, string d2, char d3)
{
Console.WriteLine("DER STRING: " + d2);
Console.WriteLine("DER INTEGER: " + d);
Console.WriteLine("DER CHARACTER: " + d3);
}
//Code ENDE
}
}