Is there any way that can you print a variable using user input? I mean for example if the user input is "A" and I have a variable A = "something"
in my code. how to print the variable using the user input "A"?
I've use char for this but it give me A not something.
String A = "something";
System.out.print("Input A");
String userInput = new Scanner(System.in).nextLine();
System.out.print(userInput);
I expect the output will "something", but the actual output is "A".