KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have a function which return a type int. However, I only have a value of the TAX enumeration. How can I cast the TAX enumeration value to an int? public enum TAX { NOTAX(0),SALESTAX(10),IMPORTEDTAX(5); private int value; private TAX(int value){ this.value = value; } } TAX var = TAX.NOTAX; // This value will differ public int getTaxValue() { // what do do here? // return (int)var; }
Tags (comma-separated)
Save Edits
Cancel