exam questions

Exam 1z0-808 All Questions

View all questions & answers for the 1z0-808 exam

Exam 1z0-808 topic 1 question 188 discussion

Actual exam question from Oracle's 1z0-808
Question #: 188
Topic #: 1
[All 1z0-808 Questions]

Given the code fragment:

What is the result?

  • A. 1 2 3 0 0 1 2 3 0 0
  • B. An Exception is thrown at run time.
  • C. 1 2 3 0 0 1 2 3
  • D. 1 2 3 1 2 3
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
epicbrozo86
3 weeks ago
For Test: public static void main(String[] args) { int array1[] = {1, 2, 3}; int array2[] = new int[5]; array2 = array1; for (int i : array2) { System.out.print(i + " "); } System.out.println(); int array3[] = new int[3]; array3 = array2; for (int i : array3) { System.out.print(i + " "); } }
upvoted 2 times
...
iSnover
2 months ago
Selected Answer: D
The answer is the letter D and there's not much to point out, when you reference an array that you had already instantiated along with arguments to another after the declaration, the variable starts to point to the other one, so it prints 1 2 3 1 2 3
upvoted 4 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago