This topic has been archived. It cannot be replied.
-
工作学习 / IT技术讨论 / What's the difference between "int a[] = new int[5]" and "int[] a = new int[5]"?
-ely(Ely);
2000-11-27
(#16011@0)
-
same
-guest:thing;
2000-11-27
(#16012@0)
-
Can u explain the following codes for me more detailly?
-ely(Ely);
2000-11-27
{816}
(#16014@0)
-
Is my question too dummy that no body want to answer it?Jabber and sailor, could u please explain the above codes for me? thanks..
-ely(Ely);
2000-11-27
(#16031@0)
-
java method passes object parameter (such as Array) by reference.
-chineloon(chineloon);
2000-11-27
(#16041@0)
-
I just want to know how the change_i(i) works and why the answer is print 1 not print 2..
What does it mean-- it has no relationship with"i" that is declared in main()--in the comments.
-ely(Ely);
2000-11-27
(#16045@0)
-
if you replace "i=j" with "i[0]=j[0]", the answer will be "D". You can think i is a pointer.
-chineloon(chineloon);
2000-11-27
(#16082@0)
-
I'm still confused how comes the method
change_i(int i[]){
...
i=j;
}
is valid..
-ely(Ely);
2000-11-28
(#16161@0)
-
more detailed.In C/C++, i of i[] is a constant pointer. In JAVA, instead, i of i[] is a variable, which points to a Array Object. When you call change_i(i), the value of i (not i itself) is passed into the methed, within which a new parameter variable i is created and assigned by the passed value.
-chineloon(chineloon);
2000-11-28
{284}
(#16245@0)
-
thanx, u answered my question but i didn't understand b4..
-ely(Ely);
2000-11-28
(#16203@0)
-
Jabber's explanation
-jabber(jabber);
2000-11-28
{1308}
(#16181@0)