• Post Reply Bookmark Topic Watch Topic
  • New Topic

Java question Help!!!  RSS feed

 
joe kane
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI,
I am writing an standard program, first I display an input box with three options 1,2 & 3 and is valadated e.g only numbers, OK so if the user enters 1 then another input box shows details of a client (which is hardcoded). when the user presses enter I want to display the first screen again with the options, rewriting the code wont work because it needs to start @ the begining of the code,
What would be the command to start the program @ the begining, e.g. calling the so it will start at the beginning, or is there another way, using a method or something.
Thanks loads in advance
Thanks joePC
 
Vicken Karaoghlanian
Ranch Hand
Posts: 522
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't just call the main mehtod again because it will cause 'Stack Overflow' error if i'm not mistaken. But what can you do, is take the code you need from the 'main' mathod and place it in another method and then you call that method as many times you want.
 
joe kane
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the info, now for calling the method with out passing anything to it or getting anything from it e.g. then returning nothing e.g.
Will this work or do I have to add somthing.
Thanks again joePC
 
Vicken Karaoghlanian
Ranch Hand
Posts: 522
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your code may look something like this
 
joe kane
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the help, got it sorted....
Thanks joePC
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!