File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Win a copy of Groovy Fundamentals video training course this week in the Groovy forum!
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: 24189

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.
I agree. Here's the link:
subject: need help with method