자격증/OCJP_ExamC
QUESTION 1
IT grow.
2018. 7. 19. 23:34
반응형
QUESTION 1Given:11. String test = "Test A. Test B. Test C.";12. // insert code here13. String[] result = test.split(regex);Which regular expression, inserted at line 12, correctly splits test into "Test A", "Test B", and "Test C"?A. String regex = "";B. String regex = " ";C. String regex = ".*";D. String regex = "\\s";E. String regex = "\\.\\s*";F. String regex = "\\w[ \.] +";Solution : E
plus imformation
A.
T
e
s
t
A
.
T
e
s
t
B
.
T
e
s
t
C
.
B.
Test
A.
Test
B.
Test
C.
C.
<no output>
D.
Test
A.
Test
B.
Test
C.
E.
Test A
Test B
Test C
F.
Main.java:12: illegal escape character
String regex = "\\w[ \.] +";
^
1 error
반응형