You are given an enum SI with three constants. Each constant stores a string field with its quantity name:
enum SI {
M("length"),
KG("mass"),
S("time");
public final String quantityName;
SI(String quantityName) {
this.quantityName = quantityName;
}
}
Declare the instance method getQuantityName that returns the quantity name of the constant.