Write the output of the following String method:

ICSE Class 10 Computer Applications PYQ · 2025 Paper · Section A

2(ii)1 Mark · 2025 · Section A · 2025 Paper

Write the output of the following String method:

String x = "talent";
String y = "matrix";
System.out.println(x.substring(3).concat(y.substring(3)));
Show SolutionHide Solution↓
entrix
  • x.substring(3) returns the substring of "talent" from index 3 onwards, i.e., "ent".
  • y.substring(3) returns the substring of "matrix" from index 3 onwards, i.e., "rix".
  • The concat() method joins both substrings: "ent" + "rix" = "entrix".
← Previous questionNext question →

Browse the free Computer Applications sample bank