public static int[] allBetween()
{
Scanner input = new Scanner(System.in);
int first;
int last;
System.out.println("Enter the first number");
first = input.nextInt();
System.out.println("Enter the last number");
last = input.nextInt();
int[] between = {((last - first) + 1)};
for(int count = 0; count <= (last - first); count++)
{
between[count] = (first + count);
}
return between;
}
I'm a little rusty and I dont't see the issue here, I have tried manually assigning the size of the array to 100 and first and last to 1 and 5 but it still returns the same error.
any ideas?
this is my first post on stack over flow, Please correct me if I'm posting in an incorrect manner