Is there a way to add a key to a HashMap without also adding a value? I know it seems strange, but I have a HashMap> amd I wan
HashMap>
I'm not sure you want to do this. You can store null as a value for a key, but if you do how will be able to tell, when you do a .get("key") whether the key exists or if it does exist but with a null value? Anyway, see the docs.
null
.get("key")