Insert into a Map in D365 F&O - X++ Code
Insert into a Map in D365 F&O - X++ Code
Insert into a Map in D365 F&O - X++ Code
5 key and values
No of elements 5
internal final class CodePractice
{
public static void main(Args _args)
{
Map map = new Map (Types::Integer, Types::String);
// inserting key and values
map.insert (1,"Rumman");
map.insert (2,"Osman");
map.insert (3,"Musar");
map.insert (4,"Inzamamul");
map.insert (5,"Hassan");
if (! map.empty ())
{
info (strFmt ("No of elements %1 ", map.elements ()));
}
}
}
First understand the algorithm carefully. Then study the program line-by-line and compare it with the output. Finally, review the explanation section to strengthen your logic and programming understanding.
Rewrite the program without looking at the code. Modify values, conditions or logic and run it again. This helps improve confidence and strengthens coding skills much faster.
Sign in to save your progress and continue exactly where you left off.