- Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmapDemo.java
More file actions
Latest commit
20 lines (16 loc) · 618 Bytes
/
Copy pathmapDemo.java
File metadata and controls
20 lines (16 loc) · 618 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
packagemine.twentyOne.map;
importjava.util.*;
publicclassmapDemo {//21题
publicstaticvoidmain(String[] args) {
// TODO Auto-generated method stub
Map<String, String[]> city = newHashMap<String, String[]>();
city.put("辽宁省", newString[]{"沈阳","大连","锦州"});
city.put("河北省", newString[]{"石家庄","保定","衡水"});
city.put("null", newString[]{"北京","上海","天津","重庆"});
System.out.println("请输入一个省份:");
Scannerin = newScanner(System.in);
Stringa = in.next();
String[] cities = city.get(a);
System.out.println(Arrays.toString(cities));
}
}