43 lines
1.1 KiB
C#
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
|
|
}
|
|
} |