Hmm...
I'm not too sure whether I fully understood what you are asking but I'll try answering.
You would like to know how your program would execute the string "System.out.println(\"Hello world\");";...
Well maybe you could assign "Hello World" to the String ah rather than , "System.out.println(\"Hello world\")";
Then depending on the users choice (I'm assuming that your program will be dependent on user input (?)) i.e. if they clicked 1 this would indicate the instruction of printing the string ah to screen.
Don't know much about your program - so have made assumptions. If you want clearer, detailed help/advice you need to post further details as the other posters have mentioned!