Advertisements
Advertisements
प्रश्न
Given that:
String sp = "Spectroscорy";
String sq = sp.substring(8);
What will be the value of sq?
विकल्प
scopy
copy
opy
Error
MCQ
Advertisements
उत्तर
copy
Explanation:
The substring(8) method extracts all characters starting from index position 8 to the end of the string. Since Java uses zero-based indexing, counting from 0 places index 8 on the letter 'c', isolating the word copy.
shaalaa.com
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
