Added Toto example

This commit is contained in:
Digi
2024-01-15 20:36:51 +01:00
parent b0b287ca7c
commit 7fd045d69d
70 changed files with 4141 additions and 4 deletions

View File

@@ -0,0 +1,64 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp2
{
class Jarmu
{
public int Evjarat { get; set; }
public string Marka { get; set; }
public string Tulajdonos { get; set; }
public virtual void Tulaj()
{
Console.WriteLine($"{Tulajdonos} elégedett a {Marka} márkájú {Evjarat}-es évjáratú járművével.");
}
}
class Auto : Jarmu {
public override void Tulaj()
{
Console.WriteLine($"{Tulajdonos} elégedett a {Marka} márkájú {Evjarat}-es évjáratú autójával.");
}
}
class Motor : Jarmu
{
public override void Tulaj() {
Console.WriteLine($"{Tulajdonos} elégedett a {Marka} márkájú {Evjarat}-es évjáratú motorjával.");
}
}
class Valami
{
private string[] adat = new string[5];
public string this[int index]
{
get { return adat[index]; }
set { adat[index] = value;}
}
}
internal class Program
{
static void Main(string[] args)
{
Jarmu j = new Jarmu { Evjarat = 1999, Marka = "Suzuki", Tulajdonos = "Szabó Márton"};
j.Tulaj();
Jarmu j2 = new Auto{ Evjarat = 1999, Marka = "Suzuki", Tulajdonos = "Szabó Márton" };
Jarmu j3 = new Motor { Evjarat = 1999, Marka = "Suzuki", Tulajdonos = "Szabó Márton" };
j2.Tulaj();
j3.Tulaj();
Valami asd = new Valami();
asd[0] = "asd";
asd[1] = "xd";
Console.WriteLine(asd[0]);
Console.WriteLine(asd[1]);
}
}
}