Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

need help with method

 
Monic Sherm
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am having problem with writing a method that asks the user to make a choice.

I have tried using boolean
for example:
Do you like vanilla or chocolate?
Boolean vanilla = true
Boolean chocolate = false

Should I use boolean or string

If anyone has time to write a quick example I would really appreciate it.
I think that I am over-thinking this and really getting stuck.


thanks in advance for your help.
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's a routine for Java 5. It could undoubtedly be improved upon but it's a start.

 
Monic Sherm
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your help. Late last night/this morning. I came up with a method that work using a string method.

Thanks again.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic