RosettaCodeData/Task/Associative-array-Creation/Apex/associative-array-creation-1.apex
2023-07-01 13:44:08 -04: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') );