Java tutorial
/* * Output: public static void main(String args[]) { lastIndexOf(the, 50) = -1 * */ public class MainClass { public static void main(String args[]) { String s = "public static void main(String args[]) {"; System.out.println(s); System.out.println("lastIndexOf(the, 50) = " + s.lastIndexOf("the", 50)); } }