下面的代碼無效的值類型:字符串整數
public List<Map<String,String>> getPhoneData() {
List<Map<String, String>> mapp = new List<Map<String, String>>();
Map<String, Integer> temp
= new Map<String, Integer>{'type' => 'Profile Value', 'count' => 1};
return mapp;
}
是給我
Compile Error: Invalid value type: String for Integer
在3線
我想用一個數值String
等Integer
創建Map
。怎麼做?
錯誤解釋什麼是錯誤的,你的Map是,並且你傳遞它{String => String}。改爲傳遞{String => Integer}。 –
@EricLeschinski:「type」是'String'。現在檢查我的問題 –
別人回答後不要改變問題的性質。 –