File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Enums in Java needed Clarity Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Enums in Java needed Clarity" Watch "Enums in Java needed Clarity" New topic
Author

Enums in Java needed Clarity

Chand Prem
Greenhorn

Joined: Nov 26, 2012
Posts: 1
Hi

I want to know how to validate users input (for ex Month name) using enums in Java. Can some one provide a examples or a link explaining it.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38033
    
  22
Welcome to the Ranch

Why do you think enums are any good for validating inputs?
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11161
    
  16

I think this is a common mistake many people make. They ask a question along the lines of "How do I use X to do Y?".

The better question would be "What is the correct way to do Y?". By already deciding what technology to use before you think about what the problem you are trying to solve is, you box yourself into a corner.


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Enums in Java needed Clarity
 
Similar Threads
alternative for interface
What is Enums?
regarding enums
Significant difference between if:loop and loop:if?
What features C++ has, but Java is missing