nerdexam
Oracle

1Z0-803 · Question #27

Given the fragment: What is the result?

The correct answer is F. 35. The two elements 3 and 4 (starting from position with index 2) are copied into position index 1 and 2 in the same array. After the arraycopy command the array looks like: {1, 3, 4, 4, 5}; Then element with index 1 is printed: 3 Then element with index 4 is printed: 5 Note:The Sys

Using Operators and Decision Constructs

Question

Given the fragment:

What is the result?

Exhibit

1Z0-803 question #27 exhibit

Options

  • A14
  • B15
  • C24
  • D25
  • E34
  • F35

How the community answered

(46 responses)
  • A
    2% (1)
  • B
    4% (2)
  • C
    2% (1)
  • E
    13% (6)
  • F
    78% (36)

Explanation

The two elements 3 and 4 (starting from position with index 2) are copied into position index 1 and 2 in the same array. After the arraycopy command the array looks like: {1, 3, 4, 4, 5}; Then element with index 1 is printed: 3 Then element with index 4 is printed: 5 Note:The System class has an arraycopy method that you can use to efficiently copy data from one array into another: public static void arraycopy(Object src, int srcPos, Object dest, int destPos, int length) The two Object arguments specify the array to copyfromand the array to copyto. The three int arguments specify the starting position in the source array, the starting position in the destination array, and the number of array elements to copy.

Topics

#operators#expression evaluation#control flow

Community Discussion

No community discussion yet for this question.

Full 1Z0-803 Practice