basically he is saying that your main would be like something like this:
public void main(String[] args)
{
run();
}
run()
{
bunch of code
}
take a look at this example that i actually used:
Code:
public static void main (String args[])
{
(new FitClub()).run();
}
public void run()
{
String msg = " *******Members Menu******* \n" +
"Select one of the following options:\n"+
"1. Add Club Members\n" +
"2. Delete a Member\n" +
"3. Display the Club Members\n" +
"4. Exit\n" +
"\nYour Choice:";
while(true)
{
String str = JOptionPane.showInputDialog(null, msg, "", 1);
int sel = Integer.parseInt(str);
switch(sel)
{
case 1:
addMembers();
break;
case 2:
deleteMember();
break;
case 3:
head();
displayMembers();
break;
case 4:
return;
default:
System.out.println("Wrong choice, try again.");
}
}//end while
}//end run
Bookmarks