RosettaCodeData/Task/Associative-array-Creation/Apex/associative-array-creation-1.apex
2016-12-05 23:44:36 +01:00

9 lines
358 B
Text

// Cannot / Do not need to instantiate the algorithm implementation (e.g, HashMap).
Map<String, String> strMap = new Map<String, String>();
strMap.put('a', 'aval');
strMap.put('b', 'bval');
System.assert( strMap.containsKey('a') );
System.assertEquals( 'bval', strMap.get('b') );
// String keys are case-sensitive
System.assert( !strMap.containsKey('A') );