Hallo, sollte eigentlich nicht das folgende Code true liefern? Da es ein false geliefert wird ???
Gruß,
G.M.
Code:
public enum Tage
{
montag,dienstag,mittwoch,donnerstag
,freitag,sonnabend,sonntag;
public boolean isWerktag()
{
switch (this)
{
case sonntag :
case sonnabend :return false;
default :return true;
}
}
public static void main(String [] _)
{
System.out.println(sonntag.isWerktag());
}
}
Gruß,
G.M.