1.用java,源码myeclipse无法查看源码怎么把php数组转换成HashMap或者集合
用java,怎么把php数组转换成HashMap或者集合
public class Test
{
public static void main(String[] args)
{
List<HashMap<String, Object>> list = new ArrayList<HashMap<String,Object>>();
HashMap<String, Object> map = new HashMap<String, Object>();
map.put("url", "abc");
map.put("alt","");
list.add(map);
HashMap<String, Object> map1 = new HashMap<String, Object>();
map1.put("url", "bcd");
map1.put("alt", "");
list.add(map1);
HashMap<String, Object> map2 = new HashMap<String, Object>();
map2.put("url", "cde");
map2.put("alt", "");
list.add(map2);
for(HashMap<String, Object> lists : list)
{
System.out.println(lists);
}
}
}
结果:
{ alt=, url=abc}
{ alt=, url=bcd}
{ alt=, url=cde}
拉脫維亞發現「不明飛行物」越境 北約戰機緊急升空
小米抢购软件java源码
安卓内核合并源码_安卓内核合并源码怎么弄
码长为8源码补码_补码8000h的原码
7旬婦人主動脈狹窄、血管嚴重阻塞 1方法幫他成功延續生命
集字卡php源码_集字卡怎么做