So I need to create a method which would take ints and return an array of length 3 with those three ints as they have been input.
This is what I have created, but it returns this [I@7852e922
public class IntsToArray {
public static int[] fill(int a, int b, int c){
int[] array = new int[3];
array[0] = a;
array[1] = b;
array[2] = c;
return (array);
}
public static void main(String[] args){
int a = Integer.parseInt(args[0]);
int b = Integer.parseInt(args[1]);
int c = Integer.parseInt(args[2]);
int[] array = fill(a, b, c);
System.out.println(array);
}
}
What am I doing wrong?