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