posted 14 years ago
Hi all
See the following
enum SwithModulePorts {
e25(25,1), e26(26,2), e28(28,3), e29(29,4);
private int uplink;
private int port; // price of each apple
// Constructor
SwithModulePorts(int uplink, int port) {
this.uplink = uplink;
this.port = port;
}
int getUplinkPort() {
return port;
}
int getUplink() {
return uplink ;
}
}
In the above code by giving 25 i want to get 1.
I do not want to use enums like e25.
I do not want to use the following.
SwithModulePorts.e25.getPort()