0

How we can name the HashMap at runtime:

for eg

String s="wow"

and i want to have a hashmap created at runtime as below

HashMap<String,String> wow=new HashMap<String,String>();

how we can acheive the same

Harry S
  • 63
  • 1
  • 10
  • 1
    Why do you want that? – Oliver Charlesworth Mar 28 '16 at 11:10
  • This does not work in Java. What do you want to do? – sinclair Mar 28 '16 at 11:10
  • for what you are saying, it seems that every time you create a string, you want to create a variable. Even if it was possible, I am wondering how useful it could be – Marco Altieri Mar 28 '16 at 11:11
  • @ Oliver @ sinclair @ Macro............ I need to read a file and save the content of the file in some hashmap and with the condition that file name should me same as of hashMap name.......As i will be get the name of file at rumtime so will have to create the hashmap @ runtime too.... – Harry S Mar 29 '16 at 07:02

0 Answers0