Computer Applications

The output of a program which extracts a part of the string "COMPASSION" is as follows:

(a) "PASS"
(b) "PASSION"

Write appropriate Java statements to get the above outputs.

Java String Handling

3 Likes

Answer

(a) "COMPASSION".substring(3, 7);

(b) "COMPASSION".substring(3);

Answered By

1 Like


Related Questions