Search code examples
javaarraysmethodsreturncell

Cell array method return


I know in methods when returning it would be the type you want returned.

public int numbers(){
    return number;
}

public String sentence(){
    return sentence;
}

but what if it's a Cell[], what would be the return type? I want to return the entire Cell[] from a method.


Solution

  • Maybe I'm missing something, but why not

    public Cell[] cells(){
        return cells;
    }