English

To extract the word NOW from the word “ACKNOWLEDGEMENT”, the Java statement “ACKNOWLEDGEMENT”.substring(3, ______) is used. Choose the correct number to fill in the blank. - Computer Applications

Advertisements
Advertisements

Question

To extract the word NOW from the word “ACKNOWLEDGEMENT”, the Java statement “ACKNOWLEDGEMENT”.substring(3, ______) is used.

Options

  • 6

  • 7

  • 5

  • 8

MCQ
Fill in the Blanks
Advertisements

Solution

To extract the word NOW from the word “ACKNOWLEDGEMENT”, the Java statement “ACKNOWLEDGEMENT”.substring(3, 6) is used.

Explanation:

In Java, the substring(start, end) The method extracts characters from the start index up to, but not including, the end index. In the world “ACKNOWLEDGEMENT”The letters ‘N’, ‘O’, and ‘W’ are at indices 3, 4, and 5; therefore, the end index must be 6 to include the character at index 5.

shaalaa.com
  Is there an error in this question or solution?
2025-2026 (March) Official Board Paper
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×