public static void main ( String [] args ) { Map String , String map = new HashMap (); map . put ( "strain" , "s1" ); map . put ( "sTrain" , "s2" ); System . out . println ( map ); map . put ( "strain" , "s3" ); System . out . println ( map
public static void main(String[] args) {
Map<String, String> map = new HashMap<>();
map.put("strain", "s1");
map.put("sTrain", "s2");
System.out.println(map);
map.put("strain", "s3");
System.out.println(map);
}
output
{strain=s1, sTrain=s2}
{strain=s3, sTrain=s2}
由此可见,Map的key是对大小写敏感的。