public class StringSample { public static void main(String[] args) { restOf(restOf(restOf("cowboy"))); int x=55; System.out.println(restOf(String.valueOf(x))); String sentence = "The name is James Bond, BOnd"; // use indexOf to get the next space, and then check if next character // is capital. int count=0; int loc=0; if (Character.isUpperCase(sentence.charAt(0))) count++; loc = sentence.indexOf(' ', 0); while(loc!=-1) { System.out.println("loc is: " + loc + " charAt loc is: " + sentence.charAt(loc)); loc = sentence.indexOf(' ', loc+1); if (loc!=-1) if (Character.isUpperCase(sentence.charAt(loc+1))) count++; } System.out.println(count); // use for loop to iterate through each char in the string count=0; if (Character.isUpperCase(sentence.charAt(0))) count++; for (int i=0; i