whats the output?

Teny

(╯°□°)╯︵ ┻━┻
Messages
5,957
Location
United States
so heres the code fragment.

String einsteinQuote =
"Peace Cannot be kept by force; it can" +
" only be archived by understanding.";
System.out.print (
einsteinQuote.indexOf ("can") + "" +
einsteinQuote.indexOf ("can", 7) + "" +
einsteinQuote.lastIndexOf ("can"));

I need to find the output of this. I'm thinking its "only be" since it starts from "can", and ends after 7 spaces over where its on "b(e)".
making sure if i am getting the right output or not.
 
Back
Top Bottom