| Author |
why can't my arraycopy work???
|
ming ming
Ranch Hand
Joined: May 17, 2006
Posts: 54
|
|
when i pass in more than 10 it will show me indexoutofbound...didn't i have the arraycopy method... :roll:
|
 |
Keith Lynn
Ranch Hand
Joined: Feb 07, 2005
Posts: 2341
|
|
|
Look at what the last parameter of arraycopy represents.
|
 |
ming ming
Ranch Hand
Joined: May 17, 2006
Posts: 54
|
|
what shall i put then??
|
 |
Pinkal Patel
Ranch Hand
Joined: Jun 16, 2006
Posts: 57
|
|
|
fish.legth instade of newFise.legnth
|
Pinkal Patel<br />SCJP 1.5<br />Preparing for SCWCD
|
 |
ming ming
Ranch Hand
Joined: May 17, 2006
Posts: 54
|
|
i dun get it..y must we put fish.length instead of newFish.length..can someone explain 2 me??
|
 |
Pinkal Patel
Ranch Hand
Joined: Jun 16, 2006
Posts: 57
|
|
What is the length of newfish Array ? and What is the length of fish Array ? If your loop is moving as much time as length of newfish what happen.... it will try to acces fish[newFish.length-1 ] which will throws Exception
|
 |
wise owen
Ranch Hand
Joined: Feb 02, 2006
Posts: 2023
|
posted

0
|
|
|
 |
Bert Bates
author
Sheriff
Joined: Oct 14, 2002
Posts: 8712
|
|
|
For those of you keeping score, you won't have to worry about the System.arraycopy method, it's not on the exam - yea!
|
Eliminate fossil fuel subsidies. (If you're not on the edge, you're taking up too much room.)
|
 |
 |
|
|
subject: why can't my arraycopy work???
|
|
|