MCQ Practice Single Best Answer Topic: ICSE Computer Application - Class X - Selection Examination - 2024-25 - MCQ - CALCUTTA PUBLIC SCHOOL

Q Which of these methods of the class String is used to extract a single character from a string object?

Question ID
#23890
Subchapter
ICSE Computer Application - Class X - Selection Examination - 2024-25 - MCQ - CALCUTTA PUBLIC SCHOOL
Action
Choose one option below

Choose Your Answer

Click an option to check whether your answer is correct.

  • A CHARAT()
  • B charat()
  • C charAt()
  • D CharAt()
Correct 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().

Share This Question

Share this MCQ with your friends or study group.