問題文
A copy is taken of a range whose end index lies past the length of the source array of references, and the call succeeds with a result whose tail holds empty slots. Which of these accounts is the one the class backs?
選択肢
- The end index has to lie inside the length of the source, because the class reads the end index as a length rather than as a position and each index past the end of the source is folded back into the range
- The end index may lie past the length of the source, because the class fills the copy out to the length that the two indexes ask for and only a source of references may be read past its own end
- The end index may lie past the length of the source, because the class pads the copy out to the length that the two indexes ask for and every slot past the source is a reference to nothing
- The end index has to lie inside the length of the source, because the class checks both indexes against the source before it copies and any index past the end of it ends the call with a bad index