Home / Questions / (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)));
Explanatory Question

(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)));

👁 37 Views
📘 Detailed Answer
🕒 Easy to Read
Read the answer carefully and go through the related questions on the right side to improve your understanding of this topic.

Answer with Explanation

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