• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Converting user inputs to enum constants

 
Mike Chen
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,

I am creating a dictionary/vocab program and having users input the word, the definition, and the part of speech, but I would like the part of speech to be an enum constant. I have a PartOfSpeech enum with the NOUN, VERB, ADJECTIVE, and ADVERB values, and would like to have the user input the part of speech as an abbreviation (n/v/adj/adv). What is the best way to take the user input as an abbreviation and convert that into an enum constant? Thanks.
 
Darryl Burke
Bartender
Posts: 5116
11
Java Netbeans IDE Opera
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Map
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic