java - Arrays (toString) not output correctly -


Actually this walk continues from the other. There were not enough characters to continue there anyway. The problem is that the output is "1 (10) 2 (23) 3 (29)" although I can return the string for array values ​​(10, 23, 29) and the string reference as 1, 2 and 3 I use. My question is that it is possible to return the index value 1,2,3 as well as return the array values. Am I making a sense of what I have done here ...

  // int [] group = {10, 23, 29}; Constructor string in tampe = ""; String tempB = ""; Int [] temp = new int [4]; Int length = groups Length; For (int j = 0; j & lt; length; j ++) {temp [j] = group [j]; TempB = tempB + "(" + goups + ")"; } Groups = temporary; Arrays.sort (coingroups); (Int i = 1; i & lt; groups.length; i ++) {tempA = tempA + "+ (i) +" ("+ group [i] +") ";} return temporary;   

With the code below you are creating a string and this string represents the entire array. Still it will be hard to work with, then use only array group

  // int {] groups = {10, 23, 29}; = "" in constructor string tampay; For (int j = 0; j and lt; group.lanta; j ++) {TempA = tempA + "+ + + +" ("+ group [j] +") "; } Return temporary;  

Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -