I am new to java, and I have a problem that I just have no idea how to fix. I've been searching here on stackoverflow and on other sites and I am just so confused.
I am just trying to copy my l array to a new array that's called A...
Here is my code:
public class Problem3 {
public static void main(String args[]) {
int l[] = new int[]{1, 2, 3};
ArrayTools.print();
ArrayTools.createIntArray();
//hämta class ArrayTools och alla metoder
}
}
class ArrayTools {
public static void print (){
System.out.println ("ArrayTools");
}
public int [] createIntArray (int l){
int [] A = l.clone();
System.out.println(A);
return A;
}
}
And what I get is a "int cannot be dereferenced" error when I try to compile my code.
And also I get another error with the ArrayTools.createIntArray, but I will figure that out later.