This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma 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
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: 24189
    
  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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: need help with method
 
It's not a secret anymore!