|
|||
|
If i have a file which contains some data..and say that i want to assign the values of every other line in the file to an arraylist of objects. How do you do it please? Thanx in advance...
|
|
||||
|
Hello nadman123.
Welcome to the Java Programming Forums! What type of file are you talking about? Is it a .txt file? To start, id read in the file line by line. You can find out exactly how to do this here: How to Read a file line by line You can then add the strLine String to an arraylist. Have you coded anything so far? Please post what you have here and we will help you fill in the gaps. If not, post an example of the data file and I will see what I can do. |
|
|||
|
Quote:
Quote:
In the student class there are methods called setName, getName, setAddress, getAddres...and so on..you know the accessors and mutators with default constructor and the constructor... I know how to create an arraylist not from a file though. like Java Code:
private ArrayList<Student> students;
students = new ArrayList<Student>();
generateStudents();
private void generateStudents(){
students.add(new Student("John Smith", "19999999","100 Dandenong Road, Caulfield East, Vic 3145","0-99112233" ));
.............
............
...........
so on.....
}
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
|
100 most searched terms
Search Cloud
|
| "bad endpoint type" com.sun.xml.internal.messaging.saaj.soapexceptionimpl com.sun.xml.internal.messaging.saaj.soapexceptionimpl: bad endpoint type com.sun.xml.internal.messaging.saaj.soapexceptionimpl: java.security.privilegedactionexception com.sun.xml.internal.messaging.saaj.soapexceptionimpl: java.security.privilegedactionexception: com.sun.xml.internal.messaging.saaj.soapexceptionimpl: java.security.privilegedactionexception: com.sun.xml.internal.messaging.saaj.soapexceptionimpl: message send failed com.sun.xml.internal.messaging.saaj.soapexceptionimpl: message send failed com.sun.xml.messaging.saaj.soapexceptionimpl: java.security.privilegedactionexception com.sun.xml.messaging.saaj.soapexceptionimpl: java.security.privilegedactionexception: com.sun.xml.messaging.saaj.soapexceptionimpl: message send failed convert arraylist to map date_format_now eclipse shortcut keys ejb3 quartz java convert double to binary java forum java forums java jtextarea bold java jtextarea color java jtextarea font java jtextarea font size java programmer forum java programmers forum java programming forum java programming forums java read last line java read last line of file java sendkeys java.security.privilegedactionexception java.security.privilegedactionexception: com.sun.xml.internal.messaging.saaj.soapexceptionimpl java.security.privilegedactionexception: com.sun.xml.internal.messaging.saaj.soapexceptionimpl: bad response java.security.privilegedactionexception: com.sun.xml.internal.messaging.saaj.soapexceptionimpl: message send failed java.security.privilegedactionexception: com.sun.xml.messaging.saaj.soapexceptionimpl: message send failed javapf javaprogrammingforums jtextarea bold jtextarea font jtextarea font color jtextarea font size programing forums programming forums reset jcombobox saaj0008 saaj0008: bad response; bad request saaj0008: bad response; not found severe: saaj0008 severe: saaj0008: bad response; bad request severe: saaj0008: bad response; not found soap java.security.privilegedactionexception soapexceptionimpl: bad endpoint type textpad java |