(So Im just strating out with Java, I've already read a book, and almost done a second). Anyway I'm trying to create a program that create word lists using the users input and then writing them to a file. I have most of the code done, im just the most important part! Below is the code, it has some annotations describing the problems. I have two main problems: A) How do I convert the user's String input into the value of my enum, right now i have it set to "{hi, hey, hello, yellow, yo, back}" but in order for the program to work outside of the IDE where i can change that value I need to be able to assign it any value on the fly. and B) How do I have to go about in order to also have numbers in the Symbol object (in order to allow numbers to be added to the combination). Any help is appreciated, and very much welcomed.
import static java.lang.System.in; import static java.lang.System.out; import java.util.Scanner; public class dic { enum Symbol {hi, hey, hello, yellow, yo, back}; // these are just values I used in order to demonstrate what the program is supposed to do, // I need to find a way to get the user to input public static void main(String args[]) { String choises = ""; //This line and the input line I want the user to use in order to get letters and words for the 'for' loops below Scanner input = new Scanner(in); out.print("Please type the words and/or letters you with to use, and sepparate each of them with a comman and a space."); out.println("i.e. 'apples, orange, pear, etc."); // I then need a way to that this imput and give it to my enum 'Symbol. choises = input.nextLine(); for (Symbol ONE: Symbol.values()) { for (Symbol TWO : Symbol.values()) { for (Symbol THREE : Symbol.values()) { for (Symbol FOUR : Symbol.values()) { for (Symbol FIVE : Symbol.values()) { for (Symbol SIX : Symbol.values()) { out.print(ONE); out.print(TWO); out.print(THREE); out.print(FOUR); out.print(FIVE); out.println(SIX); } } } } } } out.println(choises); } }