I have a question about hash tables. How can I make it so it stores all of the user inputs? Need it to store how many the type of cars the person has. I did something similar using stack where i used push, but i dont think it works with hash. Also for some reason i get an error with this code, error in the cars.put, for some reason it does not recognize the .put. Thanks
import java.util.Hashtable;
......
......
Hashtable<String, String> cars = new Hashtable<String, String>();
cars.put("one", "toyota");
Multiple markers at this line
- Syntax error on token(s), misplaced
construct(s)
- Syntax error on tokens, delete these
tokens