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,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BeispielAbhängigkeiten
{
internal class Book
{
private string content;
private string title;
public Book(string title, string content)
{
this.title = title;
this.content = content;
}
public string GetInfos() { return this.content; }
}
}

View File

@@ -0,0 +1,17 @@
namespace BeispielAbhängigkeiten
{
internal class Program
{
static void Main(string[] args)
{
Student udo = new Student("Udo");
Book b1 = new Book("SQL", "Alles über SQL und noch viel mehr ...");
Book b2 = new Book("OOP", "Alles über OOP und noch viel mehr ...");
Book b3 = new Book("TCP", "Alles über TCO und noch viel menr ...");
udo.ReadBook(b1);
udo.ReadBook(b2);
udo.ReadBook(b3);
}
}
}

View File

@@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BeispielAbhängigkeiten
{
internal class Student
{
private string name;
private string wissen;
public Student(string name)
{
this.name = name;
}
public void ReadBook(Book book)
{
string infos = book.GetInfos();
wissen = wissen + "\n" + infos;
Console.WriteLine("Ich habe gerade gelesen: ");
Console.WriteLine(infos);
}
}
}