Advertisements
Advertisements
प्रश्न
Write a statement in Java to extract the last four characters from the word "SIMPLICITY".
अति संक्षिप्त उत्तर
Advertisements
उत्तर
System.out.println("SIMPLICITY".substring(6));
Explanation:
The substring() function extracts a segment of a string from start to end index-1. "SIMPLICITY".substring(6) extracts characters from index 6 to the end.
shaalaa.com
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
2021-2022 (March) Official Board Paper
