I've looked around and haven't found an answer to exactly what I am asking so here it is:
I'm new to Java and I need to make a class that has 3 arrays which can be called from another class. I am lost because I don't know how to "properly" create the instance so that it can be called from the other class without inheritance.
public class Book {
int[] Book0 = new int[7];
int[] Book1 = new int[4];
int[] Book2 = new int[3];
public Book {
Book0 = new int[] {1,2,3,4,5,6,7};
Book1 = new int[] {};
Book2 = new int[] {};
}
}
public class Catalogue {
public Catalogue{
}
}
In class Catalogue I'm not sure how to call the instance in class Book. Do I need to change class Book and put "this"? If so, is it this() or this.____? Or do you do that in class Catalogue?