Uebungsaufgaben_ITFA_2_SS_2025/Exercises/E19_Überladung/Exercise_3.cs
s.schueler.doz 4706d2abba E19 Ex 1 - 5
2025-02-18 09:29:00 +01:00

43 lines
1.1 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("Wert: " + d);
}
static void Output(string d, double d2)
{
Console.WriteLine("Wert 1: " + d);
Console.WriteLine("Wert 2: " + d2);
}
static void Output(double d2, string d)
{
Console.WriteLine("Wert 1: " + d);
Console.WriteLine("Wert 2: " + d2);
}
static void Output(int d, string d2, char d3)
{
Console.WriteLine("Wert 1: " + d);
Console.WriteLine("Wert 2: " + d2);
Console.WriteLine("Wert 3: " + d3);
}
//Code ENDE
}
}