Skip to content
Snippets Groups Projects
Commit 90e4489d authored by Uwe Wienkop's avatar Uwe Wienkop
Browse files

2020-05-26

parent 58ad06df
No related branches found
No related tags found
No related merge requests found
No preview for this file type
No preview for this file type
...@@ -6,11 +6,26 @@ namespace _06_UebgDiExceptions ...@@ -6,11 +6,26 @@ namespace _06_UebgDiExceptions
// eine zweite Dummy-Methode Funktion2, die wiederum einen try-catch Block besitzt und // eine zweite Dummy-Methode Funktion2, die wiederum einen try-catch Block besitzt und
// eine Methode Funktion3, die bei ihrem Aufruf einen throw mit einer selbst // eine Methode Funktion3, die bei ihrem Aufruf einen throw mit einer selbst
// erstellten Fehlerklasse zur Folge hat. Main ruft Funktion1, Funktion1 ruft Funktion2 // erstellten Fehlerklasse zur Folge hat. Main ruft Funktion1, Funktion1 ruft Funktion2
// und Funktion2 ruft Funktion3. // und Funktion2 ruft Funktion3. Setzen Sie hinter die catches jeweils ein finally
// Schreiben Sie entsprechende catch-Methoden, werfen Sie den Fehler weiter // Schreiben Sie entsprechende catch-Methoden, werfen Sie den Fehler weiter
// und stellen Sie sicher, dass das Programm unter keinen Umständen beendet wird! // und stellen Sie sicher, dass das Programm unter keinen Umständen mit einer Exception beendet wird!
class Program class Program
{ {
static void Funktion2()
{
try
{
Console.WriteLine("Letzte Anweisung des try-Blocks von Funktion 2");
}
catch()
finally
{
Console.WriteLine("Finally von Funktion 2");
}
Console.WriteLine("Ende von Funktion2");
}
static void Main(string[] args) static void Main(string[] args)
{ {
Console.WriteLine("Hello World!"); Console.WriteLine("Hello World!");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment