StringTokenizerで値を抽出した後、抽出されたフィールドでListDataオブジェクトを作成する必要があります。Java:StringTokenizerで抽出した後にオブジェクト内の値を設定する
String LIST" ="one , two , three , four , five , six , seven , eight , nine , ten " ;
StringTokenizer iTk = new StringTokenizer(LIST, ",");
while (iTk.hasMoreTokens()) {
String itemToken = iTk.nextToken();
String value = PowerQuote.getItem(itemToken); // This Method will return a value Which i need to set in the respective fields of listData
ListData listdata = new ListData(); // Once i create the Object here , how can i set the values into it ??
listdata.one =
}
class ListData {
String one;
String two;
String three ;
String four ;
String five ;
String six ;
String seven ;
String eight ;
String nine ;
String ten ;
}
質問は...ですか? – DrColossos
今後コードをインデントしてください。あなたは肯定的な反応を得る可能性が高いです。 – Tenner