Check out example codes for "how to access contents of an array from another class in java". It will help you in understanding the concepts better.

Code Example 1

class MyClass
    //Variable I want to return
    private int[] numArray = {1, 2, 3};

    public int[] getNumArray() {
        return numArray.clone();

Code Example 2

MyClass newClassObj = new MyClass();
int[] secondArray = newClassObj.getNumArray();

Learn ReactJs, React Native from