Search Results

Search found 1 results on 1 pages for 'discodude'.

Page 1/1 | 1 

  • Arrays (toString) not output correctly

    - by DiscoDude
    Hello, Actually this tread is continuing from the other one. There wasn't enough characters to continue there. Anyway. the problem is that the output is "1(10) 2(23) 3(29)". Even though I could return string for the array values (10,23,29) and used string reference as 1, 2 and 3. My question is it possible to return index values 1,2,3 and as well as array values. Am I making an sense. Here is what I have done... // int[] groups = {10, 23, 29}; in the constructor String tempA = ""; String tempB = " "; int[] temp = new int[4]; int length = groups.length; for (int j = 0; j < length; j++) { temp[j] = groups[j]; tempB = tempB + "("+goups+")"; } groups = temp; Arrays.sort(coingroups); for(int i = 1; i < groups.length;i++) { tempA = tempA+" "+(i)+ "("+groups[i]+")"; } return tempA;

    Read the article

1