Commit 88885261 authored by Uwe Wienkop's avatar Uwe Wienkop

kleine Ergänzungen

parent 64509866
......@@ -17,6 +17,10 @@ namespace _09Uhrzeit
Console.WriteLine(z2.ToString("h.m:s"));
int std1 = z1.Stunde;
int std2 = z1.getStunde();
z1.Stunde = 12;
z1.setStunde(12);
}
}
}
......@@ -10,9 +10,19 @@ namespace _09Uhrzeit
{
private int stunde, minute, sekunde;
public int getStunde() { return stunde; }
public void setStunde(int value)
{
if (value >=0 && value <=23)
stunde = value;
}
public int Stunde
{
get { return stunde; }
set {
if (value >= 0 && value <= 23)
stunde = value;
}
}
public override string ToString()
// wird aufgerufen von WriteLine(z1)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment