Projektdateien hinzufügen.

This commit is contained in:
2023-03-23 12:24:40 +01:00
parent 5fe92f4f47
commit 33e49f846c
51 changed files with 1444 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,31 @@
namespace BeispielConstructur
{
internal class Program
{
static void Main(string[] args)
{
Auto a1 = new Auto("Trabant", 150);
Auto a2 = new Auto("Papamobil");
Auto a3 = new Auto(500);
}
}
class Auto
{
private string marke;
private int ps;
public Auto(int ps) : this("Ferrari", ps) { }
public Auto(string marke) : this(marke, 50)
{
//marke = m;
//ps=50;
}
public Auto(string marke, int ps)
{
this.marke = marke;
this.ps = ps;
}
public string GetMarke() { return marke; }
public int Getps() { return ps; }
}
}