This content has been marked as final. Show 6 replies
Common question--third time I've seen it today (always worded slightly differently).
Use a Map:
(The left side of the declaration of the "map" variable could be a Map, instead of a HashMap. The right needs to be a HashMap. For your code, you'll probably want a "Map < String , String >".)
Please read all the excellent feedback then note:
A char and Character are only single characters.
When you read a line with:
It returns a String which is a Special Object for handling the common case of many char's in an array of char.
So change your char to java.lang.String or just String since you automagically
get : import java.lang.*;
Read up on java.lang.String in the JavaDoc it is a very powerful tool that Java provides.
Good luck and keep asking questions, its how we learn.