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

O

Old Programmer

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" ??????
 
J

Jeff

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" ??????

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.
 
R

Richter~9.6

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" ??????

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
 
M

murari garg

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" ??????

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top