A
Alper
Hello Java gurus
I am new to java programming. I have a problem
with Arraylist object. I wrote the program below;
import java.util.ArrayList;
public class TestDrive {
public static void main(String[] args) {
int[] test = new int[2]; //making new int array
ArrayList superList = new ArrayList(); //making ArrayList object
superList.add(test);
int [] moon = new int[2];
moon = superList.get(0); //How will I get the object reference?
}
}
I can't get the int[] array which is stored in ArrayList. if you
compile the
source code above, it returns error which is "Error(17,9): incompatible
types; found: class java.lang.Object,
required: array int[]"
please help me about this problem..
Thank you all.
I am new to java programming. I have a problem
with Arraylist object. I wrote the program below;
import java.util.ArrayList;
public class TestDrive {
public static void main(String[] args) {
int[] test = new int[2]; //making new int array
ArrayList superList = new ArrayList(); //making ArrayList object
superList.add(test);
int [] moon = new int[2];
moon = superList.get(0); //How will I get the object reference?
}
}
I can't get the int[] array which is stored in ArrayList. if you
compile the
source code above, it returns error which is "Error(17,9): incompatible
types; found: class java.lang.Object,
required: array int[]"
please help me about this problem..
Thank you all.