permaculture playing cards
The moose likes Beginning Java and the fly likes menu design Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "menu design" Watch "menu design" New topic

menu design

brian yuen

Joined: Oct 20, 2003
Posts: 20
if I wanna create a menu,
should I create tha as a object , or do something like the following(as a funcation)

[ October 22, 2003: Message edited by: brian yuen ]
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
If you're doing this all text mode, run from the command line, no fancy schmancy windows, that's a start.
Let me guess your goal is something like: "Display a menu, get a choice from the user, based on their choice do A or B or C." It might be fancy and include "repeat until user chooses to stop". I'd suggest a couple things as you go from what you typed above:
First, make a real instance of the class. So your main would look more like:

That way the methods that do the real work don't all have to be static, and they can use member variables.
Second, make runAssignment look as much like your assignment as possible.

(Choose better words!) Some people call this "programming by intention" which just means write down what you plan to do and then drill into the details in the called methods. This won't compile until you write the three methods. You can write empty ones that do nothing just to compile or comment them out for a while. Expect them to change a bit as you explore how to code the details.
Hope that helps. Keep posting your progress!

A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
I agree. Here's the link:
subject: menu design
It's not a secret anymore!