Q13
What is the correct way to check if a string starts with a specific prefix in Java?
A.
str.startsWith(prefix)
AnswerB.
str.beginsWith(prefix)
C.
str.starts(prefix)
D.
str.hasPrefix(prefix)
Answer: Option A
Solution
Answer: Option A
No explanation is given for this question Let's Discuss on Board