public class Search { public static void main(String[] a) { String s = "Summer Course"; char c = 'r'; // now I want to find out if the string S contains the character c // i do this using a linear search algorithm and the methdod .charAt() int i = 0; while (i < s.length()) { if (s.charAt(i) == c) { System.out.println("Ok, s does contain c!!"); break; // tells Java to stop looping here, since // we've just found what we were looking for } i += 1; } } }