public enum Subjects {
RUSSIAN("Russian: "),
ENGLISH("English: "),
PHYSICS("Physics: "),
INFORMATICS("Informatics: "),
HISTORY("History: ");
private String value;
private Subjects(String value) {
this.value = value;
}
public String getValue() {
return this.value;
}
}
public enum Subjects {
RUSSIAN,
ENGLISH,
PHYSICS,
INFORMATICS,
HISTORY
}
hashmap.put(RUSSIAN,2);
hashmap.put(INFORMATICS,5)
for (Map.Entry<Subjects, Integer> entry : hashmap.entrySet()) {
System.out.println(entry.getKey().name() + ": " + entry.getValue());
}