wood burning stoves*
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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "need help with method" Watch "need help with method" New topic
Author

need help with method

Monic Sherm
Greenhorn

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
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

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



[Jess in Action][AskingGoodQuestions]
Monic Sherm
Greenhorn

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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: need help with method
 
Similar Threads
want to make it an application
Which Flavor you like most?
Doubt on Enums
Counting Matches
meaning of Abstraction?