I'm using a 'Properties' class in Java which inherits from HashMap
.
I'm building a basic compiler in hashmap. I know it can be simplified using something besides a hashmap.
Here is the my code...
Properties inputSource = new Properties();
inputSource.put("ERROR", "ERROR");
inputSource.put("GET", "GET");
inputSource.put("PRINT", "PRINT");
inputSource.put("&", "&"); // this point input resource error.
I've tried to put "\&" instead, and it still didn't work.
Is there any way I can add a &
as a hashmap key?