Hi, I'm a
Java newbie and I've been really stuck on this assignment in the Osborne Java 2 book. I really would appreciate any help, even a clue or two?
In this application there are classes specifying types of queue formed in arrays, these in themselves aren't a problem to me, but where I fall down a hole is the bit where I've been asked to write a static method to copy the contents from one queue to another.
So far I've got:
class Copy {
public static int[] a;
public static int[] b;
public static int[] StaticCopy() {
a = b;
return a;
}
}
This seems to compile but I get nothing but a null value from it, because obviously it's not referencing the instance variable arrays in the queue classes. Being static the method can only reference static variables, and yet the queue arrays are non-static. Also, in the main method I shouldn't have to create an object of class Copy should I because it's static. How can I reference the non-static queue arrays, which are each in their separate classes?
As you can see I'm a bit blurry

on the whole concept and any nudge in the right direction would be much appreciated.
Thanks