exam questions

Exam 1z0-829 All Questions

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

Exam 1z0-829 topic 1 question 19 discussion

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

Given the code fragment:

What is the result?

  • A. 888
  • B. 8109
  • C. 7107
  • D. 777
  • E. 71010
  • F. 81111
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
xplorerpj
7 months, 2 weeks ago
D is correct answer
upvoted 1 times
...
Uteman
8 months, 3 weeks ago
D is the correct answer
upvoted 1 times
...
c6437d5
10 months, 2 weeks ago
Selected Answer: D
D tested correct
upvoted 3 times
...
Bharadwaj240796
11 months, 4 weeks ago
Prints : 777, correct answer!
upvoted 2 times
...
testostaws
1 year ago
Print 777. a.replace("Hello!", "Welcome!") doesn’t change a. It creates a new string which is not used. Therefore, a.indexOf("Java") will return the same index (7) both times. The same index will be returned by b.indexOf("Java") since b is created from a.
upvoted 3 times
...
supersquax
1 year ago
Right one is D. As Tojose writes, Strings are immutable. When doing a.replace(), it returns a new string which in this case isnt saved anywhere, and so "a" remains the same.
upvoted 2 times
...
meltedolive
1 year ago
right options D.
upvoted 2 times
...
Tojose
1 year ago
the right answer id D. 777, because String is unmutable
upvoted 2 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