java passing arrays to methods functions