exam questions

Exam 1z0-808 All Questions

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

Exam 1z0-808 topic 1 question 211 discussion

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

Given the code fragment:

What is the result?

  • A. S 6
  • B. S 5
  • C. s-1
  • D. w 7
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
Sudhakar_Senthilkumar
1 week, 6 days ago
Selected Answer: A
Answer A => S6
upvoted 1 times
...
MPignaProTech
2 months, 3 weeks ago
Selected Answer: A
A is correct
upvoted 1 times
...
akbiyik
2 years, 1 month ago
Selected Answer: A
Answer is A. S 6
upvoted 2 times
...
carloswork
2 years, 1 month ago
Selected Answer: A
Answer is A.
upvoted 2 times
...
UAK94
2 years, 3 months ago
Answer is A. Because String str is "Sweet Sweat" not "Sweet sweat" String str="Sweet Sweat"; String str2=str.trim().charAt(6)+" " + str.indexOf("Sw",1); System.out.println(str2); // S 6
upvoted 3 times
...
iSnover
2 years, 3 months ago
Selected Answer: C
The answer is the letter C, it is a little complicated but analyzing the code we managed to answer the question ignoring the difficult part. Looking at "str.indexOf("Sw",1)" we can see that it wants to know what is the position of the first "Sw" that appears in the String content and we can see that it is at position 1. The only alternative that prints the 1 in the second position of the string "str2" is the C option.
upvoted 1 times
Jess1985B
1 year, 1 month ago
A is correct, tested.
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