exam questions

Exam 1z0-808 All Questions

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

Exam 1z0-808 topic 1 question 84 discussion

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

Given:

What is the result?

  • A. Compilation fails.
  • B. 11
  • C. 8
  • D. 9
  • E. 10
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

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
Zafar_Nasim
Highly Voted 4 years, 7 months ago
D is correct because trim() only removes leading and lagging spaces.
upvoted 9 times
haisaco
2 years ago
No trim() just remove space on first and last string
upvoted 4 times
...
...
carloswork
Highly Voted 2 years, 2 months ago
Selected Answer: B
Answer is B. String s = "Java SE 8 1"; int len = s.trim().length(); System.out.print(len);
upvoted 6 times
...
MPignaProTech
Most Recent 3 months ago
Selected Answer: B
trim delete spaces at the begining and the end
upvoted 1 times
...
Jess1985B
1 year, 1 month ago
Answer is B - 11. Just calculate spaces before and after string.
upvoted 2 times
...
dsms
1 year, 5 months ago
Answer is: 11
upvoted 1 times
...
haisaco
2 years ago
Selected Answer: B
Answer is B.
upvoted 2 times
...
tawa_z58
2 years, 1 month ago
Answer is B trim() removes only begining and end white spaces of a string
upvoted 5 times
...
iSnover
2 years, 2 months ago
Selected Answer: B
See the code: public static void main (String[] args) { String s = "Java SE 8 1"; int len = s.trim().length(); System.out.print(len); }
upvoted 4 times
...
iSnover
2 years, 3 months ago
Selected Answer: D
D is correct, because trim remove only spaces and remember, can't be 8 because is true that Java indexes form 0, but not in case of count de size of String. I tested
upvoted 1 times
...
archer1903
2 years, 7 months ago
Selected Answer: D
Tested D. 9
upvoted 1 times
...
lilz
3 years, 10 months ago
String s = "Java Duke"; int len = s.trim().length(); System.out.println(len); D
upvoted 1 times
...
JoseCG
5 years, 2 months ago
Correct.
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