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
