Feb 7, 2001 #1 KryptoS Programmer Feb 7, 2001 240 BE how can I return a array to my main? eg. private String []array; public String ArrayReturn() { return ... // what do I have to put here to return the array to my main? }
how can I return a array to my main? eg. private String []array; public String ArrayReturn() { return ... // what do I have to put here to return the array to my main? }
Feb 7, 2001 #2 globos Programmer Nov 8, 2000 260 FR If I see your problem, you want to return the array attribute in ArrayReturn method? If so, you should write : public String[] ArrayReturn() { ... return array; } Upvote 0 Downvote
If I see your problem, you want to return the array attribute in ArrayReturn method? If so, you should write : public String[] ArrayReturn() { ... return array; }
Feb 8, 2001 #3 srikandula Programmer Dec 28, 2000 31 US here is the code how to send the array public class Help { public static void main(java.lang.String[] args) { String [] ss = send(); System.out.println(ss[0]+ss[1]+ss[2]); } public static String[] send(){ String [] arr= new String[3]; arr[0]="man"; arr[1]="two"; arr[2]= "three"; return arr; } } Upvote 0 Downvote
here is the code how to send the array public class Help { public static void main(java.lang.String[] args) { String [] ss = send(); System.out.println(ss[0]+ss[1]+ss[2]); } public static String[] send(){ String [] arr= new String[3]; arr[0]="man"; arr[1]="two"; arr[2]= "three"; return arr; } }