1. Engineering
  2. Computer Science
  3. help me trace this code...

Question: help me trace this code...

Question details

29. Consider the following method. public int locate (S tring str, String oneLetter) while (j <str.length() && str.substring (j, j+1).compar bstring (, j+1).compareTo (oneLetter) J++7 return Which of the following must be true when the while loop terminates? (A) (B) (C) str.length ) str.substring (j, j+1) j <=str.length () 11 >=0 str.substring (j, j+1) .compareTo (oneLetter) > o str.substring(j, j+1).compareTo (oneLetter) >- 0 str.substring(j, j+1).compareTo (oneLetter) >-0 (D) jstr.length I (E) str.length) &&

Help me trace this code?

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution