Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / February 2007

Tip: Looking for answers? Try searching our database.

Could you help me? How I can show data value from ArrayList?

Thread view: 
Old Programmer - 17 Feb 2007 05:14 GMT
Hi all,
  Could all help me.... I developed my program and I used ArrayList,
follow as:
===========
private int[] parseValue(String line, int lineNum)      {
   int[] v = new int [3];
   v[0] = 1;
   v[1] = 2;
   v[2] = 3;
   return v;
}

.........
........
private boolean ShowData(String fileName)
   {
       int xx[]  = null;
        ArrayList load = new ArrayList();
        while ( reader.ready() ) {
                xx =   parseValue(reader.readLine(), line);
                load.add(xx);
        }
        System.out.println(?????????);
}

=====================
How I can show data value of "load" ??????
Jeff - 17 Feb 2007 06:20 GMT
> Hi all,
>    Could all help me.... I developed my program and I used ArrayList,
[quoted text clipped - 25 lines]
> =====================
> How I can show data value of "load" ??????

What in the world are you trying to do? You have a function ParseValue
that has two arguments, neither of which is used but rather returns an
array.  You then have an ArrayList where each element is that very
same array. If this is homework, you need a session with a TA. If not,
please clarify the purpose of the program.
Richter~9.6 - 17 Feb 2007 10:04 GMT
> Hi all,
>    Could all help me.... I developed my program and I used ArrayList,
[quoted text clipped - 25 lines]
> =====================
> How I can show data value of "load" ??????

I would also love to know what you are trying to do but anyway... to
get the contents of the load ArrayList, you would probably do
something similar to the below: -

for(int[] v : load) {
  System.out.println(v[0] + ":" + v[1] + ":" + v[2] +"\n");
}

Regards,
Richard
murari garg - 17 Feb 2007 13:51 GMT
> Hi all,
>    Could all help me.... I developed my program and I used ArrayList,
[quoted text clipped - 25 lines]
> =====================
> How I can show data value of "load" ??????

are you trying to access your array list from some specific file.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.