Java Arrays and For Loop | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Java Arrays and For Loop

Good Day sirs and Ma'am, I'm new in Java so I'm having difficulties on this. How can I get a Specific Value in an Array, Like the Game is the variable name, and the value is The Forest using the Scanner Method and it will print the result.

8th Feb 2020, 12:41 AM
Ken
Ken - avatar
2 Answers
+ 6
I hope it's okay for you if a 'Mam' answers your question. What you describe is a Map. A Map (in other languages often called dictionary) stores key and value pairs. So if you put <String, String> entries to your Map it should match your expectations. As for the input, are you talking about the code playground or a standard console input?
8th Feb 2020, 10:56 AM
Tashi N
Tashi N - avatar
+ 3
Thank you for all the answer, Sir blackwinter and Ma'am Tashi N
8th Feb 2020, 11:35 AM
Ken
Ken - avatar