Creator Help

Put all Key

Table of Contentsup

Maps - Put all key

Inserts all key - value pairs into the specified map variable, if key(s) already present in the map-variable the key's associated value is replaced with new value.

Syntax

<target-map variable>.put(<source-map-variable>);

where,
<target-map variable> is a map variable in which the action take place
<source-map-variable> is a map variable from where all the key-value mappings will be added to the above target map variable

Example

In the following sample code, the key-value mappings in map named "Games" is added to another map named "Sports"

{
Games=map();
Games.put("Cricket","Sachin");
Games.put("Tennis","SteffiGraf");
Games.put(("Badminton"),"SainaNehwal");
Sports=map();
Sports.put(Games);

}

Top