textfiles和arraylist [英] textfiles and arraylist
问题描述
嗨
i有一个问题,你需要把文本文件读成一个arraylist。
我的讲师从来没有告诉我们如何实际做到这一点。我不知道怎么做有人可以请给我一个如何做的基本代码,这样我就可以尝试一下
谢谢
< blockquote class =post_quotes>
hi
i有一个问题,你需要把文本文件读成一个arraylist。
我的讲师永远不会告诉我们如何实际做到这一点..我不知道该怎么做。有人可以给我一个如何做的基本代码,这样我就可以尝试一下
谢谢
你们知道如何从文件中读取一行吗?如果是这样,你知道如何追加(添加)
a字符串到一个ArrayList吗?
亲切的问候,
Jos
你知道如何从文件中读取一行吗?如果是这样,你知道如何追加(添加)
a字符串到一个ArrayList吗?
亲切的问候,
Jos
i知道如何阅读一行...但不知道如何追加
i知道如何读取一行...但不知道如何追加
打开ArrayList类的API规范并查看在那里的方法。或者,请仔细阅读Jos上面的帖子。
hi
i got a question where you need to read a text file into an arraylist.
my lecturer never showed us how to actually do it.. and i have no idea how to do it. could someone please give me a basic code of how to do it so i can try it out
Thanks
hi
i got a question where you need to read a text file into an arraylist.
my lecturer never showed us how to actually do it.. and i have no idea how to do it. could someone please give me a basic code of how to do it so i can try it out
ThanksDo you know how to read a line from a file? If so, do you know how to append (add)
a String to an ArrayList?
kind regards,
Jos
Do you know how to read a line from a file? If so, do you know how to append (add)
a String to an ArrayList?
kind regards,
Josi have an idea how to read a line.. but not how to append
i have an idea how to read a line.. but not how to appendOpen the API specs for the ArrayList class and have a look at the methods there. Alternatively, read carefully Jos'' post above.
这篇关于textfiles和arraylist的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!