seany123 Posted June 5, 2016 Share Posted June 5, 2016 if i have an enum like this: enum manufacturers { Mazda, Ford, Fiat, Honda }; manufacturers car = manufacturers.Mazda; is it possible to then print(car) to return its current enum value? Quote Link to comment Share on other sites More sharing options...
Jacques1 Posted June 5, 2016 Share Posted June 5, 2016 (edited) // Moved from JavaScript forum Whatever language that is, it's not JavaScript. Are you confusing Java and JavaScript? Those are two entirely different languagues not related in any way. If you do mean Java, your question still makes no sense to me, because you've already answered it yourself: System.out.print(car); This does exactly what it says. It prints the name of the enum constant. Edited June 5, 2016 by Jacques1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.