public static void main(String[] args) {
String[] a={"河南省","浙江省","江西省","广东省","福建省"};
String[] b={"郑州","杭州","南昌","广州","福州"};
Map<String, String> map = new HashMap<>();
for (int i = 0; i <a.length ; i++) {
String ka=a[i];
String kb=b[i];
map.put(ka,kb);
}
System.out.println(map);
}
输出结果为:
  {福建省=福州, 浙江省=杭州, 江西省=南昌, 广东省=广州, 河南省=郑州}