Q: Which of these methods of the class String is used to extract a single character from a string object?
-
A
CHARAT()
-
B
charat()
-
C
charAt()
-
D
CharAt()
C
Answer:
C
Explanation:
Explanation:
The charAt(int index) method in the String class is used to extract a character at a specific position (index) in the string.
Java is case-sensitive, so the correct method name is charAt().
Related Topic:
Share Above MCQ