Skip to content

Instantly share code, notes, and snippets.

@BMU-Verlag
Created July 8, 2020 08:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BMU-Verlag/326d961a8dd1733dfd4f6e59d9a6c052 to your computer and use it in GitHub Desktop.
Save BMU-Verlag/326d961a8dd1733dfd4f6e59d9a6c052 to your computer and use it in GitHub Desktop.
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