• Post Reply Bookmark Topic Watch Topic
  • New Topic

java list  RSS feed

 
ekte spiriopoulos
Ranch Hand
Posts: 217
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello
I have questions if you could create something like this .
If choice ==1
system.outprintln(show list1)
Else if (choice ==2)
System.out.println(show list2)
Else (if choice ==3)
//i don't know how can I do that .I want to go back to make the user to choice==1 how can I do that?
 
Winston Gutkowski
Bartender
Posts: 10573
65
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ekte spiriopoulos wrote://i don't know how can I do that .I want to go back to make the user to choice==1 how can I do that?

I don't understand the question. Do you mean putting it in a loop, or something like:
Also: please try and provide code that compiles. What you've written (and I've copied) is NOT Java.

Winston
 
Campbell Ritchie
Marshal
Posts: 55761
163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can also create a List of Lists
 
Paul Clapham
Sheriff
Posts: 22506
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ekte spiriopoulos wrote:i don't know how can I do that .I want to go back to make the user to choice==1 how can I do that?


That isn't quite the right way to do it. If you only want the user to choose 1 then... wait a minute, you can't mean that. Asking the user to enter "1" would be annoying and confusing. I suppose you mean you only want the user to enter something from a certain list, and if they don't then you want to nag them to try again. So here's how to do that:



This is pseudo-code so you'll need to translate it into real Java code which implements your requirements.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!