(ii) Write the output of the following String method:

String x= "talent";  String y="matrix";

System.out.print(x.substring(3).concat(y.substring(3)));

Single Choice
Views 37

Answer:

Solution:

  1. x.substring(3) extracts "ent" from "talent".

  2. y.substring(3) extracts "rix" from "matrix".

  3. Concatenating both results in "entrix".

Final Output:


entrix

Related Articles:

This section is dedicated exclusively to Questions & Answers. For an in-depth exploration of ICSE Computer Applications Class 10 – Previous Year Question Papers & Solutions, click the links and dive deeper into this subject.

Join Our telegram group to ask Questions

Click below button to join our groups.