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.
Advertisements
प्रश्न
To extract the word NOW from the word “ACKNOWLEDGEMENT”, the Java statement “ACKNOWLEDGEMENT”.substring(3, ______) is used.
विकल्प
6
7
5
8
MCQ
रिक्त स्थान भरें
Advertisements
उत्तर
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
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
2025-2026 (March) Official Board Paper
