Compare the below code and what will result?
import UIKit
var rank:Dictionary = [1:”First”, 2: “Second”, 3: “Third”];
rank.updateValue(“Forth”, forKey: 4);
rank[5]=”Fifth”;
for I in rank {
print(i);
}
import UIKit
var rank:Dictionary = [2:”Second”, 1: “First”, 3: “Third”];
rank[5]=”Fifth”;
rank.updateValue(“Forth”, forKey: 4);
for I in rank {
print(i)
}
Correct Answer: Output Result will be same
Explanation:
Note: This Question is unanswered, help us to find answer for this one
More Swift MCQ Questions