exam questions

Exam 1z0-808 All Questions

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

Exam 1z0-808 topic 1 question 192 discussion

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

Which two array initialization statements are valid? (Choose two.)

  • A. int array[] = new int[3] {1, 2, 3};
  • B. int array[] = new int[3]; array[0] = 1; array[1] = 2; array[2] = 3;
  • C. int array[3] = new int[] {1, 2, 3};
  • D. int array[] = new int[3]; array = {1, 2, 3};
  • E. int array[] = new int[] {1,2,3};
Show Suggested Answer Hide Answer
Suggested Answer: BE 🗳️
Reference:
https://stackoverflow.com/questions/1200621/how-do-i-declare-and-initialize-an-array-in-java

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
MPignaProTech
2 months, 2 weeks ago
Selected Answer: BE
BE are the good answers
upvoted 1 times
...
iSnover
2 years, 3 months ago
Selected Answer: BE
The correct answers are BE: A -> Wrong, you can't put constants as you set the array size. C -> Same reason as A. D -> Same reason as above.
upvoted 1 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