generics - How to declare genericy key value pair array in java -


hello friends new java collection, need create array follows,

array( "key1":"value1", "key2":[ "key21":"value21", "key22":"value22" ], "key3":"value3" )

value's datatype's specified dynamically. if example or tutorials available please share it. in advance.

map key-value pair

    public static void main(string[] args) {         map<integer, object> map;         map = new hashmap<integer, object>();         map.put(1,"any object");         map.put(2,"fits here");         map.put(3,5555555);     } 

Comments

Popular posts from this blog

android - net_scheduler holding wakelock -

sql - MySQL : Getting Entries from a many-to-many table -

java - Retrieving data from database using jsp (Hibernate + Spring + Maven) -