jQuery in Action, 3rd edition
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 REST with Spring (video course) this week in the Spring 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: 24195

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: http://aspose.com/file-tools
subject: need help with method
It's not a secret anymore!