exam questions

Exam 1z0-808 All Questions

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

Exam 1z0-808 topic 1 question 137 discussion

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

Given the code snippet from a compiled Java source file:

Which command-line arguments should you pass to the program to obtain the following output?

Arg is 2 -

  • A. java MyFile 1 3 2 2
  • B. java MyFile 2 2 2
  • C. java MyFile 1 2 2 3 4
  • D. java MyFile 0 1 2 3
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

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
v323rs
Highly Voted 2 years, 12 months ago
The correct answer is A java MyFile 1 3 2 2
upvoted 13 times
...
iSnover
Most Recent 3 months, 1 week ago
Selected Answer: A
The correct answer is A, remembering that Java indexes from 0 and args each argument separated by space occupies each place in the list. So the variable "arg3" to print 2 , the "2" needs to be in the fourth place of the list, the only one that is is the letter A, the other arguments don't matter.
upvoted 1 times
...
WilsonKKerll
1 year, 3 months ago
java MyFile 1 3 2 2 , index 0 1 2 3 , question get args[3] value, so Answer is A, 1 3 2 2 .
upvoted 1 times
...
pln95
1 year, 3 months ago
Why A is correct ?
upvoted 1 times
JongHwa
1 year, 1 month ago
args[0] = 1 args[1] = 3 args[2] = 2 args[3] = 2 so ans A(1 3 2 2 ) is correct
upvoted 1 times
...
...
SSJ5
1 year, 9 months ago
A is correct
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