hello ,
this is showed error with me in java
List<double>[] B = new List<double>[10];
for (int i = 0; i < 10; i++)
{
B[i] = new ArrayList<double>();
}
why?
Printable View
hello ,
this is showed error with me in java
List<double>[] B = new List<double>[10];
for (int i = 0; i < 10; i++)
{
B[i] = new ArrayList<double>();
}
why?
Whats the error? I can't tell you why unless you tell me what error it is.
the error is with the list
JosAH just said what was wrong. Next time post the error message you get when you try to compile the program.
a List is an interface and can't be instantiated with new.
List<Double>[] B = new List<Double>[10];
the error about Generic array creation
any one know why?
it worked :)
another problem with the code is with count!!:
for (int i = 0; i < 10; i++)
{
insertSort(B[i], B[i].count);
}
double[] dNew = new double[50];
int nCurrent = 0;
for (int i = 0; i < 10; i++)
{
for (int j = 0; j < B[i].Count; j++)
{
dNew[nCurrent] = B[i][j];
nCurrent++;
}
}
return dNew;
We are not here to do your homework for you. I am going to copy/paste what I said in your other post.
It's very important that you ask specific questions. Vague questions like "Here is my code, help" will not receive great attention..as you have seen. What is your problem? What doesn't work? How does it not work? What have you done to try to fix it? What does it produce? What were you expecting? Does it compile? If not, what compilation errors did you get(copy/paste EXACT errors, not paraphrasing)? What do you think they mean? What do you think can be done to fix the errors?
A lot of people here are not going to scan your code and give you the answer unless you put in the effort.