Created
July 8, 2020 08:40
-
-
Save BMU-Verlag/326d961a8dd1733dfd4f6e59d9a6c052 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum Gehaltskategorien { | |
A(18000), | |
B(20400), | |
C(24000), | |
D(30000), | |
E(42000), | |
F(60000); | |
private int gehalt; | |
Gehaltskategorien(final int gehalt){ | |
this.gehalt = gehalt; | |
} | |
public int getGehalt(){ | |
return this.gehalt; | |
} | |
} | |
public class Enum { | |
public static void main(String[] args) { | |
Gehaltskategorien mitarbeiter = Gehaltskategorien.C; | |
System.out.print("Das Jahresgehalt des Mitarbeiters beträgt " + mitarbeiter.getGehalt() + " Euro."); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment