I have a situation, where I have to apply a criteria on an input array and reuturn another array as output which will have smaller size based upon the filtering criteria.
Just return any kind of list. ArrayList will be fine, its not static.
ArrayList list = new ArrayList(); for (yourClass item : yourArray) { list.add(item); }