Projektdateien hinzufügen.
This commit is contained in:
10
BeispielAbhängigkeiten/BeispielAbhängigkeiten.csproj
Normal file
10
BeispielAbhängigkeiten/BeispielAbhängigkeiten.csproj
Normal 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>
|
||||
21
BeispielAbhängigkeiten/Book.cs
Normal file
21
BeispielAbhängigkeiten/Book.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
17
BeispielAbhängigkeiten/Program.cs
Normal file
17
BeispielAbhängigkeiten/Program.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
26
BeispielAbhängigkeiten/Student.cs
Normal file
26
BeispielAbhängigkeiten/Student.cs
Normal 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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user