What is the result?

Given:
18. String s = ” abcdcba “;
19. int x = 2;
20. s = s.trim();
21. if (s.length() < 8) {
22. x = s.indexOf(‘c’, 3);
23. }
24. System.out.println(“x = ” + x);
What is the result?

Given:
18. String s = ” abcdcba “;
19. int x = 2;
20. s = s.trim();
21. if (s.length() < 8) {
22. x = s.indexOf(‘c’, 3);
23. }
24. System.out.println(“x = ” + x);
What is the result?

A.
x = 5

B.
x = 2

C.
x = 3

D.
x = 4

E.
x = 6



Leave a Reply 0

Your email address will not be published. Required fields are marked *