1
我翻譯一個JavaScript函數來Java和我有低於這個text
變量,煩惱如何聲明和在Java中使用它:結構與字符數組的索引和INT的價值
的Javascript:
var text={}; // Index will be several arrays, and value an integer
var word; // Will contain several chars, like a string
var myChar; // Will contain only one char
var value; // Will contain one integer
[...]
if(text[word+myChar]!=null)
{ // In this comparison, word is "hell", myChar is "o" and value is 1234
text[word+myChar]=value;
}
感謝您的幫助