How can we find the length of a string in Java?
Answer options
A
length()
B
size()
C
len
D
length
Correct answer: length()
Explanation
Quick AnswerThe correct answer is length() because it directly addresses the core logic of Practice Set 2.
In Java, String length is retrieved via the length() method.