Data Type Java Tutorial

public class MainClass
{
   public static void main( String args[] )
   {
      String letters = "abcdefghijklmabcdefghijklm";
      System.out.printf( "Last 'c' is located at index %d\n",
          letters.lastIndexOf( 'c' ) );
       System.out.printf( "Last 'a' is located at index %d\n",
          letters.lastIndexOf( 'a', 25 ) );
       System.out.printf( "Last '$' is located at index %d\n\n",
          letters.lastIndexOf( '$' ) );
   }
}
Last 'c' is located at index 15
Last 'a' is located at index 13
Last '$' is located at index -1