Q: Which of the 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:
The method used to extract a single character from a String object in Java is charAt().
Explanation:
charAt(int index) is a method of the String class that returns the character at the specified index in the string. The index is zero-based, meaning the first character is at index 0.
Correct Answer:
c) charAt()
Related Topic:
Share Above MCQ