Hi guys, I've a question for you! I have an object of this kind: PosCoord(char amm, String moves, int[] coord), where coord is an array of coordinates. I created an array "scorpo" of PosCoord, length 29: PosCoord [] scorpo = new PosCoord[29]; Now I write: int [] c = {0,0,0}; for(int i=0;i<scorpo.length;i++) { scorpo[i] = new PosCoord(Protein.letterSeq[i], "NO", c); } where letterSeq is an array of char. If I do: scorpo[1].coord[1]=scorpo[0].coord[1]+1; and I try to show the coords of scorpo[0] and scorpo[1] now I see that they are the same, while I want scorpo[1].coord[1] to be 1 and scorpo[0].coord[1] to be 0. Why does it happen??And how can I solve the problem!!??Help me please!! Thanx!! -Mauri-
|