Advertisements
Advertisements
प्रश्न
Write the output of the following String method:
String x= “ talent” ; String y=”matrix” ;
System.out.print(x.substring(3).concat(y.substring(3)));कोड लेखन
Advertisements
उत्तर
'entrix"
Explanation:
The method x.substring(3) extracts the characters of x starting from index 3 up to the end, resulting in "ent". Similarly, y.substring(3) extracts the characters of y from index 3 to the end, giving "rix". These two strings are then joined together using the concat() method.
shaalaa.com
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
2024-2025 (March) Official Board
