This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes need help with method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Beginning Java
Bookmark "need help with method" Watch "need help with method" New topic

need help with method

Monic Sherm

Joined: Sep 30, 2005
Posts: 13
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

Joined: Jul 08, 2003
Posts: 24187

Here's a routine for Java 5. It could undoubtedly be improved upon but it's a start.

[Jess in Action][AskingGoodQuestions]
Monic Sherm

Joined: Sep 30, 2005
Posts: 13
Thanks for your help. Late last night/this morning. I came up with a method that work using a string method.

Thanks again.
GeeCON Prague 2014
subject: need help with method