arraylist

    0熱度

    1回答

    是否有任何將scala.collection.Iterator轉換爲java列表的直接API。 我嘗試以下操作: val xs = Iterator[POJO] println("xs size : " + xs.size) import com.google.common.collect.Lists; val p = Lists.newArrayList(xs) **output** :

    0熱度

    2回答

    我發現了一個聊天服務器的代碼,我有一個簡短的問題。這是關於以下摘錄: clientOutputStreams.add(作家); 顯然,這種字符串數組應該被髮送到聊天客戶端,但我不明白怎麼陣列不斷被更新 - 即如何發送到由特殊的聊天客戶端的服務器字符串數組中accumualated然後送回給所有聊天客戶。你做?將不勝感激你的幫助。 import java.io.*; import java.net

    0熱度

    1回答

    早上好, 我是編程新手。 我想寫一個程序,它從鍵盤讀取一些數字並將它們相加。我到達寫一個程序,總結數字,我的問題是,我不知道如何配置掃描儀來填充數組/ ArrayList。 我怎麼辦? 這是我的代碼。 class array { public static void main(String[] args) { int start = 0; int [] interi = {2

    -3熱度

    1回答

    我想減去兩個數組列表。 兩者的ArrayList包含以下數據 [1, 1, 5, 1, 1] 我使用Apache庫執行操作。 List resultList = ListUtils.subtract(sections, sections); 操作完成,但我的結果如下 [] 當我需要它是 [0, 0, 0, 0, 0] 我怎麼會去這樣做呢?

    0熱度

    1回答

    我有一個ArrayList正在使用Customer類填充客戶信息。在我的addCustomerRecord方法中,我在addCustomerRecord方法中調用findAddIndex,這樣輸入的數據將在顯示數據之前排序。這裏是我的代碼,不介意fileWhatever方法,我不使用它。 public class CustomerDemo { //arrayList of custom

    3熱度

    1回答

    我仍然在學習封裝。我有一個GrammarList,其中每個Grammar emcapsulated有一個陣列listRule與他們的所有setter &獲得者。因爲在這裏看到: public class Grammar { private enum Type {Left, Right, NULL}; private String Nom; private static Type type

    -2熱度

    2回答

    我是新來的Java和我卡在一個點,我應該完成一個靜態ArrayList方法;我必須使用for循環。我試圖問幾個人,但我根本不明白該怎麼做。 它看起來像這樣(我應該去完成它) public static ArrayList<Message> getMessagesTo(Person recipient) { ArrayList<Message> allMessages = getMessa

    -1熱度

    1回答

    public SortedArrayList<T> incrementItems(int increment) { for(T sh: this) { Integer newValue = (Integer) sh + (Integer) increment; this.set(this.indexOf(sh), (T) newValue); } return t

    -4熱度

    2回答

    我想創建一個使用for循環在我的MainActivity.java中的虛擬對象的ArrayList。這似乎是我得到我創建的每個對象的對象引用做工精細: for(int i=0; i < 10; i++){ new TaskObjects("Title " + i, "Category " + i, "Description " + i, i + 10); Log.d("For

    0熱度

    1回答

    我有一個方法,應該返回Response與JsonObject(與arraylist)完全一樣的本文的代碼。這是一個java @GET方法。我知道如何建立一個與jsonobject像json.createObjectBuilder: JsonObject jo = Json.createObjectBuilder().add("name", "item").add("user", user.getU