A.
This is my explaination for the above code segment:Code:String s = "perserverance"; String t = s.substring(4, 6); String u = s.substring(3, 8); String v = s.substring(0, 9); System.out.println(t); System.out.println(u); System.out.println(v);
1. Takes the substream at the 5th character and stops at the 7th character in the string s.
2. Takes the substream at the 4th character and stops at 9th in the string s.
3. Takes the substream at the 1st character and stops at the 10th in the string s.
Is that correct? Is there any step after that? What is the output of it will look like?


Reply With Quote
For more help, 


Bookmarks