?
-
i have a method 'getNames()' which returns a list of names.
the problem is i have no idea whether i should make the return type a
"String[]" or a "List".
i am using a List inside the method and if i am returning a String[] i
will just call the toArray method. but then again, i can simply return
the List.
does anybody know the rule of thumb in deciding what return type is
appropriate?
the problem is i have no idea whether i should make the return type a
"String[]" or a "List".
i am using a List inside the method and if i am returning a String[] i
will just call the toArray method. but then again, i can simply return
the List.
does anybody know the rule of thumb in deciding what return type is
appropriate?